class Uber::Options
Public Class Methods
Source
# File lib/uber/options.rb, line 6 def initialize(options) @static = options options.each do |k,v| self[k] = Option[v, instance_exec: true] end end
Public Instance Methods
Source
# File lib/uber/options.rb, line 24 def eval(key, *args) self[key].(*args) end
Evaluates a single value.
Source
# File lib/uber/options.rb, line 15 def evaluate(context, *args) {}.tap do |evaluated| each do |k,v| evaluated[k] = v.(context, *args) end end end
Evaluates every element and returns a hash. Accepts context and arbitrary arguments.