Class: Negative

Inherits:
Latex show all
Defined in:
lib/annlat/LaRuby.rb

Overview

represents -@expr

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Latex

#*, #**, #+, #-, #-@, #/, #glue, #is, #my_json, #ne, #of, #to_ltx, #wrap

Constructor Details

#initialize(some_expr) ⇒ Negative

Returns a new instance of Negative.



88
89
90
91
# File 'lib/annlat/LaRuby.rb', line 88

def initialize(some_expr) 
  @expr = some_expr.to_ltx 
  (@expr = @expr.wrap) if (@expr.kind_of?(Sum))
end

Instance Attribute Details

#exprObject (readonly)

Returns the value of attribute expr.



87
88
89
# File 'lib/annlat/LaRuby.rb', line 87

def expr
  @expr
end

Instance Method Details

#latexObject



93
94
95
# File 'lib/annlat/LaRuby.rb', line 93

def latex
  '-' + @expr.latex
end