Module: Necromancy::Control::Applicative
- Extended by:
- Necromancy::Control
- Included in:
- Alternative
- Defined in:
- lib/necromancy/control/applicative.rb
Instance Method Summary collapse
-
#*(callable) ⇒ Necromancy
(also: #__Applicative_Astarisk)
A -> c.
-
#**(callable) ⇒ Necromancy
A variant of #* with the arguments reversed.
-
#<<(callable) ⇒ Necromancy
Sequence actions, discarding the value of the callable.
-
#>>(callable) ⇒ Necromancy
Sequence actions, discarding the value of self.
Methods included from Necromancy::Control
[], call, extended, hiding, new, using
Instance Method Details
#*(callable) ⇒ Necromancy Also known as: __Applicative_Astarisk
Note:
- self
-
a -> b -> c
Returns a -> c.
16 17 18 19 |
# File 'lib/necromancy/control/applicative.rb', line 16 def *(callable) str = make_evaluable_string(callable) self.class.new("args.concat((#{str})); #{@necromancy}", @references.dup) end |
#**(callable) ⇒ Necromancy
Note:
- self
-
a -> b
A variant of #* with the arguments reversed.
30 31 32 33 |
# File 'lib/necromancy/control/applicative.rb', line 30 def **(callable) str = make_evaluable_string(callable) self.class.new(str, @references.dup).__Applicative_Astarisk(self) end |
#<<(callable) ⇒ Necromancy
Note:
- self
-
a -> b
Sequence actions, discarding the value of the callable.
44 45 46 |
# File 'lib/necromancy/control/applicative.rb', line 44 def <<(callable) self.class.new("args.pop; #{@necromancy}", @references.dup).__Applicative_Astarisk(callable) end |
#>>(callable) ⇒ Necromancy
Note:
- self
-
a -> _
Sequence actions, discarding the value of self.
57 58 59 60 |
# File 'lib/necromancy/control/applicative.rb', line 57 def >>(callable) str = make_evaluable_string(callable) self.class.new("args.pop; #{str}", @references.dup).__Applicative_Astarisk(self) end |