------ art_64364_28481602.1199813907896 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline FYI: I used the new netbeans 6 to find this quickly.... command+O: then type "Cipher", you will see two options near the top, both in openssl.rb files but one is in a directory called "rubystubs" which tells me right away it's in C and there isn't ruby source available... the stub file doesn't it's best to document even those defined methods but it's tough if there is no documentation in the C layer. then you are off to the source code for more snooping. M On Jan 8, 2008 12:33 PM, Mike McKinney <mike.s.mckinney / gmail.com> wrote: > it's in C: > <ruby_src>/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 < alessio.spam / gmail.com> 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 penSSL::Random.random_bytes(self.key_len) > > self.key tr > > return str > > end > > > > def random_iv > > str penSSL::Random.random_bytes(self.iv_len) > > self.iv tr > > return str > > end > > end > > > > Where does this class defines the cipher method? > > > > Thanks! > > -- > > Posted via http://www.ruby-forum.com/. > > > > > ------ art_64364_28481602.1199813907896--