Class: Uber::Option
- Inherits:
-
Object
- Object
- Uber::Option
- Defined in:
- lib/uber/option.rb
Class Method Summary collapse
-
.[](value, options = {}) ⇒ Object
TODO: instance_exec: true.
Class Method Details
.[](value, options = {}) ⇒ Object
TODO: instance_exec: true
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/uber/option.rb', line 5 def self.[](value, ={}) # TODO: instance_exec: true if value.is_a?(Proc) return ->(context, *args) { context.instance_exec(*args, &value) } if [:instance_exec] return value end return value if value.is_a?(Uber::Callable) return ->(context, *args){ context.send(value, *args) } if value.is_a?(Symbol) ->(*) { value } end |