Class: Declarative::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/declarative/option.rb,
lib/declarative/option/version.rb

Constant Summary collapse

VERSION =
"0.1.0"

Instance Method Summary collapse

Instance Method Details

#call(value, options = {}) ⇒ Object



9
10
11
12
13
14
# File 'lib/declarative/option.rb', line 9

def call(value, options={})
  return lambda_for_proc(value, options)     if value.is_a?(Proc)
  return lambda_for_symbol(value, options)   if value.is_a?(Symbol)
  return lambda_for_callable(value, options) if callable?(value, options)
  lambda_for_static(value, options)
end