Class: BinOpe
Direct Known Subclasses
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#oper ⇒ Object
readonly
Returns the value of attribute oper.
Instance Method Summary collapse
-
#initialize(some_oper, *some_args) ⇒ BinOpe
constructor
A new instance of BinOpe.
- #latex ⇒ Object
Methods inherited from Latex
#*, #**, #+, #-, #-@, #/, #glue, #is, #my_json, #ne, #of, #to_ltx, #wrap
Constructor Details
#initialize(some_oper, *some_args) ⇒ BinOpe
Returns a new instance of BinOpe.
122 123 124 125 126 127 128 |
# File 'lib/annlat/LaRuby.rb', line 122 def initialize(some_oper, *some_args) @oper = some_oper.to_ltx some_args.map!(&:to_ltx) first = some_args[0] rest = some_args[1..-1].map {|a| (a.kind_of?(BinOpe) and a.args[0].kind_of?(Negative)) ? a.wrap : a } @args = [first] + rest end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
119 120 121 |
# File 'lib/annlat/LaRuby.rb', line 119 def args @args end |
#oper ⇒ Object (readonly)
Returns the value of attribute oper.
120 121 122 |
# File 'lib/annlat/LaRuby.rb', line 120 def oper @oper end |
Instance Method Details
#latex ⇒ Object
130 131 132 |
# File 'lib/annlat/LaRuby.rb', line 130 def latex @args.map{|a| a.latex}.join(@oper.latex) end |