From: Mike McKinney Date: 2008-01-09T02:33:16+09:00 Subject: Re: where is that method defined? ------=_Part_64297_20669039.1199813601084 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline it's in C: /ext/openssl/ossl_ssl.c line 899 (for ruby 1.8.6 source) rb_define_method(cSSLSocket, "cipher", ossl_ssl_get_cipher, 0); On Jan 8, 2008 12:20 PM, Alex Ma wrote: > 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! > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_64297_20669039.1199813601084--