Class: Simmer::Util::Resolver
- Inherits:
-
Object
- Object
- Simmer::Util::Resolver
- Defined in:
- lib/simmer/util/resolver.rb
Overview
Wraps up Objectable so it can be plugged into Stringento so we can use Objectable as an object resolver.
Instance Attribute Summary collapse
-
#objectable_resolver ⇒ Object
readonly
Returns the value of attribute objectable_resolver.
Instance Method Summary collapse
-
#initialize(objectable_resolver: Objectable.resolver) ⇒ Resolver
constructor
A new instance of Resolver.
- #resolve(value, input) ⇒ Object
Constructor Details
#initialize(objectable_resolver: Objectable.resolver) ⇒ Resolver
Returns a new instance of Resolver.
17 18 19 20 21 |
# File 'lib/simmer/util/resolver.rb', line 17 def initialize(objectable_resolver: Objectable.resolver) @objectable_resolver = objectable_resolver freeze end |
Instance Attribute Details
#objectable_resolver ⇒ Object (readonly)
Returns the value of attribute objectable_resolver.
15 16 17 |
# File 'lib/simmer/util/resolver.rb', line 15 def objectable_resolver @objectable_resolver end |
Instance Method Details
#resolve(value, input) ⇒ Object
23 24 25 |
# File 'lib/simmer/util/resolver.rb', line 23 def resolve(value, input) objectable_resolver.get(input, value) end |