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.
139 140 141 142 |
# File 'lib/method_object.rb', line 139 def initialize(attributes, subclass) self.attributes = attributes super(subclass) end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
137 138 139 |
# File 'lib/method_object.rb', line 137 def attributes @attributes end |
Class Method Details
.call(attributes:, subclass:) ⇒ Object
133 134 135 |
# File 'lib/method_object.rb', line 133 def self.call(attributes:, subclass:) new(attributes, subclass).call end |
Instance Method Details
#call ⇒ Object
144 145 146 147 |
# File 'lib/method_object.rb', line 144 def call define_attr_readers define_initializer end |