Class: Servies::OperationFinder
- Inherits:
-
Object
- Object
- Servies::OperationFinder
- Defined in:
- lib/servies/operation_finder.rb
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
Instance Method Summary collapse
-
#initialize(namespace, backend, autocall = false) ⇒ OperationFinder
constructor
A new instance of OperationFinder.
- #method_missing(name, attributes = {}) ⇒ Object
- #respond_to_missing?(name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(namespace, backend, autocall = false) ⇒ OperationFinder
Returns a new instance of OperationFinder.
7 8 9 10 11 |
# File 'lib/servies/operation_finder.rb', line 7 def initialize(namespace, backend, autocall = false) @namespace = namespace @backend = backend @autocall = autocall end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, attributes = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/servies/operation_finder.rb', line 13 def method_missing(name, attributes = {}) klass = _find_klass(name) instance = klass.new(attributes.merge(backend: backend)) if @autocall instance.call else instance end end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
5 6 7 |
# File 'lib/servies/operation_finder.rb', line 5 def backend @backend end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
5 6 7 |
# File 'lib/servies/operation_finder.rb', line 5 def namespace @namespace end |
Instance Method Details
#respond_to_missing?(name, include_private = false) ⇒ Boolean
24 25 26 |
# File 'lib/servies/operation_finder.rb', line 24 def respond_to_missing?(name, include_private = false) _find_klass(name) end |