minor doubt

Hello Rubyist,

class_eval and instance_eval is kind of opposite of its behaviour why we
have so?

class_eval is creating instance method while,
instance_eval is creating class method.

Thanks
Raj Kumar

There's a fairly good explanation of that behaviour here..
https://www.jimmycuadra.com/posts/metaprogramming-ruby-class-eval-and-instance-eval/

⁣Sent from BlueMail ​

···

On 17 Mar 2018, 10:43, at 10:43, Raj Kumar Sharma <raj4057kumar@gmail.com> wrote:

Hello Rubyist,

class_eval and instance_eval is kind of opposite of its behaviour why
we
have so?

class_eval is creating instance method while,
instance_eval is creating class method.

Thanks
Raj Kumar

------------------------------------------------------------------------

Unsubscribe:
<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;