Class: Simmer::Util::Resolver

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_resolverObject (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