Class: MethodObject::Setup
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- MethodObject::Setup
- Defined in:
- lib/method_object.rb
Overview
Dynamically defines custom attr_readers and initializer.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(attributes, subclass) ⇒ Setup
constructor
A new instance of Setup.
Constructor Details
#initialize(attributes, subclass) ⇒ Setup
Returns a new instance of Setup.
136 137 138 139 |
# File 'lib/method_object.rb', line 136 def initialize(attributes, subclass) self.attributes = attributes super(subclass) end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
134 135 136 |
# File 'lib/method_object.rb', line 134 def attributes @attributes end |
Class Method Details
.call(attributes:, subclass:) ⇒ Object
130 131 132 |
# File 'lib/method_object.rb', line 130 def self.call(attributes:, subclass:) new(attributes, subclass).call end |
Instance Method Details
#call ⇒ Object
141 142 143 144 |
# File 'lib/method_object.rb', line 141 def call define_attr_readers define_initializer end |