Class: MethodObject
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- MethodObject
show all
- Defined in:
- lib/method_object.rb,
lib/method_object/version.rb
Overview
See gemspec for description.
Defined Under Namespace
Classes: AmbigousMethodError, ObjectFactory, PotentialDelegator, PotentialDelegatorWithPrefix, Setup
Constant Summary
collapse
- VERSION =
'3.0.0'
Class Attribute Summary collapse
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
|
#respond_to_missing?(*args) ⇒ Boolean
169
170
171
|
# File 'lib/method_object.rb', line 169
def respond_to_missing?(*args)
super || __getobj__.respond_to?(*args)
end
|