Class: Functional::Inject
Direct Known Subclasses
Instance Attribute Summary collapse
-
#it ⇒ Object
(also: #end)
readonly
Returns the value of attribute it.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(start, *a, &e) ⇒ Inject
constructor
A new instance of Inject.
- #inject_fun(*a) ⇒ Object (also: #call)
Methods inherited from Base
Constructor Details
#initialize(start, *a, &e) ⇒ Inject
Returns a new instance of Inject.
186 187 188 189 |
# File 'lib/functional.rb', line 186 def initialize start, *a, &e super *a, &e @it = start end |
Instance Attribute Details
#it ⇒ Object (readonly) Also known as: end
Returns the value of attribute it.
183 184 185 |
# File 'lib/functional.rb', line 183 def it @it end |
Instance Method Details
#inject_fun(*a) ⇒ Object Also known as: call
191 192 193 |
# File 'lib/functional.rb', line 191 def inject_fun *a @it = @exe.call @it, *a end |