Class: Funk::InputFn
Constant Summary
Constants inherited from Fn
Instance Attribute Summary
Attributes inherited from Fn
Instance Method Summary collapse
- #call(input) ⇒ Object
-
#initialize(name, _ = nil) ⇒ InputFn
constructor
A new instance of InputFn.
Constructor Details
#initialize(name, _ = nil) ⇒ InputFn
Returns a new instance of InputFn.
12 13 14 15 |
# File 'lib/funk/input_fn.rb', line 12 def initialize(name, _=nil) @name = name @dependencies = [] end |
Instance Method Details
#call(input) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/funk/input_fn.rb', line 17 def call(input) if input.has_key?(name) input[name] else NO_INPUT_PROVIDED end end |