class UberOptionTest::Value
Public Class Methods
new(value, options={})
click to toggle source
# File lib/uber/options.rb, line 45 def initialize(value, options={}) @value, @dynamic = value, options[:dynamic] @proc = proc? @callable = callable? @method = method? return if options.has_key?(:dynamic) @dynamic = @proc || @callable || @method end
Public Instance Methods
call(context, *args)
click to toggle source
# File lib/uber/options.rb, line 57 def call(context, *args) return @value unless dynamic? evaluate_for(context, *args) end
Also aliased as: evaluate
callable?()
click to toggle source
# File lib/uber/options.rb, line 72 def callable? @value.is_a?(Uber::Callable) end
dynamic?()
click to toggle source
# File lib/uber/options.rb, line 64 def dynamic? @dynamic end
method?()
click to toggle source
# File lib/uber/options.rb, line 76 def method? @value.is_a?(Symbol) end
proc?()
click to toggle source
# File lib/uber/options.rb, line 68 def proc? @value.kind_of?(Proc) end