Class: Integer
- Defined in:
- lib/lab419/core/integer/operators.rb,
lib/lab419/core/integer/instance_methods.rb
Constant Summary collapse
- Summer =
-> *args do args.reduce{ |a,b| a + b } end
- Differ =
-> a, b do a - b end
- Multiplier =
-> *args do args.reduce{ |a,b| a * b } end
- Divisor =
-> a, b do a / b end
- Modulator =
-> a, b do a % b end
Class Method Summary collapse
- .diff ⇒ Object (also: -)
- .div ⇒ Object (also: /)
- .mod ⇒ Object (also: %)
- .pred ⇒ Object
- .prod ⇒ Object (also: *)
- .succ ⇒ Object
- .sum ⇒ Object (also: +)
Class Method Details
.diff ⇒ Object Also known as: -
20 |
# File 'lib/lab419/core/integer/operators.rb', line 20 def diff; Differ end |
.div ⇒ Object Also known as: /
34 |
# File 'lib/lab419/core/integer/operators.rb', line 34 def div; Divisor end |
.mod ⇒ Object Also known as: %
41 |
# File 'lib/lab419/core/integer/operators.rb', line 41 def mod; Modulator end |
.pred ⇒ Object
3 4 5 |
# File 'lib/lab419/core/integer/operators.rb', line 3 def pred lambda{ |a| a.pred } end |
.prod ⇒ Object Also known as: *
27 |
# File 'lib/lab419/core/integer/operators.rb', line 27 def prod; Multiplier end |
.succ ⇒ Object
6 7 8 |
# File 'lib/lab419/core/integer/operators.rb', line 6 def succ lambda{ |a| a.succ } end |