Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/watirmark/extensions/ruby_extensions.rb
Overview
From Why’s Poignant Guide
Instance Method Summary collapse
-
#class_def(name, &blk) ⇒ Object
Defines an instance method within a class.
- #meta_class ⇒ Object
-
#meta_def(name, &blk) ⇒ Object
Adds methods to a metaclass.
- #meta_eval(&blk) ⇒ Object
Instance Method Details
#class_def(name, &blk) ⇒ Object
Defines an instance method within a class
84 85 86 |
# File 'lib/watirmark/extensions/ruby_extensions.rb', line 84 def class_def name, &blk class_eval { define_method name, &blk } end |
#meta_class ⇒ Object
68 69 70 71 72 |
# File 'lib/watirmark/extensions/ruby_extensions.rb', line 68 def class << self self end end |
#meta_def(name, &blk) ⇒ Object
Adds methods to a metaclass
79 80 81 |
# File 'lib/watirmark/extensions/ruby_extensions.rb', line 79 def name, &blk { define_method name, &blk } end |
#meta_eval(&blk) ⇒ Object
74 75 76 |
# File 'lib/watirmark/extensions/ruby_extensions.rb', line 74 def &blk .instance_eval &blk end |