Class: Meta2::Resolver
- Inherits:
-
Object
- Object
- Meta2::Resolver
- Defined in:
- lib/meta2/resolver.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
Instance Method Summary collapse
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
3 4 5 |
# File 'lib/meta2/resolver.rb', line 3 def context @context end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/meta2/resolver.rb', line 3 def @options end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
3 4 5 |
# File 'lib/meta2/resolver.rb', line 3 def strategy @strategy end |
Instance Method Details
#detect ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/meta2/resolver.rb', line 9 def detect Meta2.debug "strategy: #{strategy}" strategy_class_name = "Meta2::Strategies::#{@strategy.to_s.camelize}" strategy = strategy_class_name.constantize.new @options strategy.detect end |
#setup(strategy, context, options) ⇒ Object
5 6 7 |
# File 'lib/meta2/resolver.rb', line 5 def setup(strategy, context, ) @strategy, @context, @options = strategy, context, end |