Module: DSLKit::ClassMethod
Instance Method Summary collapse
-
#class_attr_accessor(*ids) ⇒ Object
Define reader and writer attribute methods for all *ids.
-
#class_attr_reader(*ids) ⇒ Object
Define reader attribute methods for all *ids.
-
#class_attr_writer(*ids) ⇒ Object
Define writer attribute methods for all *ids.
-
#class_define_method(name, &block) ⇒ Object
Define a class method named name using block.
Methods included from Eigenclass
Instance Method Details
#class_attr_accessor(*ids) ⇒ Object
Define reader and writer attribute methods for all *ids.
39 40 41 |
# File 'lib/dslkit/polite.rb', line 39 def class_attr_accessor(*ids) eigenclass_eval { attr_accessor(*ids) } end |
#class_attr_reader(*ids) ⇒ Object
Define reader attribute methods for all *ids.
44 45 46 |
# File 'lib/dslkit/polite.rb', line 44 def class_attr_reader(*ids) eigenclass_eval { attr_reader(*ids) } end |
#class_attr_writer(*ids) ⇒ Object
Define writer attribute methods for all *ids.
49 50 51 |
# File 'lib/dslkit/polite.rb', line 49 def class_attr_writer(*ids) eigenclass_eval { attr_writer(*ids) } end |
#class_define_method(name, &block) ⇒ Object
Define a class method named name using block. To be able to take blocks as arguments in the given block Ruby 1.9 is required.
34 35 36 |
# File 'lib/dslkit/polite.rb', line 34 def class_define_method(name, &block) eigenclass_eval { define_method(name, &block) } end |