????JFIF??x?x????'
| Server IP : 172.67.174.47  /  Your IP : 216.73.216.113 Web Server : LiteSpeed System : Linux premium151.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : tempvsty ( 647) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /././././proc/thread-self/root/opt/alt/ruby18/share/ri/1.8/system/Module/ | 
| Upload File : | 
--- !ruby/object:RI::MethodDescription 
aliases: []
block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Defines an instance method in the receiver. The <em>method</em> parameter can be a <tt>Proc</tt> or <tt>Method</tt> object. If a block is specified, it is used as the method body. This block is evaluated using <tt>instance_eval</tt>, a point that is tricky to demonstrate because <tt>define_method</tt> is private. (This is why we resort to the <tt>send</tt> hack in this example.)
- !ruby/struct:SM::Flow::VERB 
  body: "   class A\n     def fred\n       puts "In Fred"\n     end\n     def create_method(name, &block)\n       self.class.send(:define_method, name, &block)\n     end\n     define_method(:wilma) { puts "Charge it!" }\n   end\n   class B < A\n     define_method(:barney, instance_method(:fred))\n   end\n   a = B.new\n   a.barney\n   a.wilma\n   a.create_method(:betty) { p self }\n   a.betty\n"
- !ruby/struct:SM::Flow::P 
  body: <em>produces:</em>
- !ruby/struct:SM::Flow::VERB 
  body: "   In Fred\n   Charge it!\n   #<B:0x401b39e8>\n"
full_name: Module#define_method
is_singleton: false
name: define_method
params: |
  define_method(symbol, method)     => new_method
  define_method(symbol) { block }   => proc
visibility: public