From: Markus Schirp Date: 2008-01-09T02:27:34+09:00 Subject: Re: where is that method defined? Am Wed, 9 Jan 2008 02:20:26 +0900 schrieb Alex Ma : > I'm looking at ruby code for a class, for which I can call a method > but which I don't find in the class source code. > > I suppose this is a feature of Ruby that I have yet to learn. > Can anyone help me please? > > Specifically, the class is Cipher in openssl module (fully qualified > class name s OpenSSL::Cipher::Cipher) and its source code in Ruby > library is: > > class Cipher > def random_key > str = OpenSSL::Random.random_bytes(self.key_len) > self.key = str > return str > end > > def random_iv > str = OpenSSL::Random.random_bytes(self.iv_len) > self.iv = str > return str > end > end > > Where does this class defines the cipher method? > > Thanks! The method may be defined in an C extension. Download ruby sources and lookup under 'ext' directory. -- Seonic IT-Systems GbR Anton Shatalov & Markus Schirp Kopernikusstr.6 D-51789 Lindlar --- www.seonic.net info@seonic.net