Class: MethodObject
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- MethodObject
- Defined in:
- lib/method_object.rb,
lib/method_object/version.rb
Overview
See gemspec for description.
Defined Under Namespace
Classes: AmbigousMethodError, ObjectFactory, PotentialDelegator, PotentialDelegatorWithPrefix
Constant Summary collapse
- VERSION =
'3.0.1'
Class Attribute Summary collapse
-
.__object_factory__ ⇒ Object
Returns the value of attribute object_factory.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.__object_factory__ ⇒ Object
Returns the value of attribute object_factory.
21 22 23 |
# File 'lib/method_object.rb', line 21 def __object_factory__ @__object_factory__ end |
Class Method Details
.attrs(*attributes) ⇒ Object
17 18 19 |
# File 'lib/method_object.rb', line 17 def attrs(*attributes) self.__object_factory__ = ObjectFactory.create(*attributes) end |
.call(**args) ⇒ Object
11 12 13 |
# File 'lib/method_object.rb', line 11 def call(**args) new(__object_factory__&.new(**args)).call end |
Instance Method Details
#call ⇒ Object
24 25 26 |
# File 'lib/method_object.rb', line 24 def call raise(NotImplementedError, 'define the call method') end |