Module: MagicLogic::Operator
- Included in:
- Base
- Defined in:
- lib/magic_logic/operator.rb
Instance Method Summary collapse
Instance Method Details
#<=>(q) ⇒ Object
38 39 40 |
# File 'lib/magic_logic/operator.rb', line 38 def <=>(q) (self >= q) * (q >= self) end |
#>=(q) ⇒ Object
34 35 36 |
# File 'lib/magic_logic/operator.rb', line 34 def >=(q) (~self + q) end |
#_(ope, l, r) ⇒ Object
3 4 5 |
# File 'lib/magic_logic/operator.rb', line 3 def _ ope, l, r ope == :+ ? l : r end |
#~@ ⇒ Object
27 28 29 30 31 32 |
# File 'lib/magic_logic/operator.rb', line 27 def ~@ if is_neg? then p elsif is_form? then vars.map(&:~).inject(_ ope, :*, :+) else NEG.new(self) end end |