Class: Uber::Options::Value
- Inherits:
-
Object
- Object
- Uber::Options::Value
- Defined in:
- lib/uber/options.rb
Overview
TODO: rename to Value.
Instance Method Summary collapse
- #dynamic? ⇒ Boolean
- #evaluate(context, *args) ⇒ Object
-
#initialize(value, options = {}) ⇒ Value
constructor
A new instance of Value.
Constructor Details
#initialize(value, options = {}) ⇒ Value
Returns a new instance of Value.
43 44 45 46 |
# File 'lib/uber/options.rb', line 43 def initialize(value, ={}) @value = value || true @options = end |
Instance Method Details
#dynamic? ⇒ Boolean
54 55 56 |
# File 'lib/uber/options.rb', line 54 def dynamic? @options[:instance_method] || @value.kind_of?(Proc) end |
#evaluate(context, *args) ⇒ Object
48 49 50 51 52 |
# File 'lib/uber/options.rb', line 48 def evaluate(context, *args) return true if @value.is_a?(TrueClass) evaluate_for(context, *args) end |