Class: Mathmas::Variable
- Inherits:
-
Object
- Object
- Mathmas::Variable
- Includes:
- Basic
- Defined in:
- lib/mathmas/core/symbol.rb
Overview
Class for Symbol like x, y, etc.
Instance Attribute Summary collapse
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
-
#initialize(symbol) ⇒ Variable
constructor
A new instance of Variable.
- #to_s ⇒ Object
- #to_tex ⇒ Object
Methods included from Basic
#*, #**, #+, #-, #/, #coerce, #to_iruby
Constructor Details
#initialize(symbol) ⇒ Variable
Returns a new instance of Variable.
7 8 9 |
# File 'lib/mathmas/core/symbol.rb', line 7 def initialize(symbol) @symbol = symbol end |
Instance Attribute Details
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
5 6 7 |
# File 'lib/mathmas/core/symbol.rb', line 5 def symbol @symbol end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/mathmas/core/symbol.rb', line 11 def to_s @symbol.to_s end |
#to_tex ⇒ Object
15 16 17 |
# File 'lib/mathmas/core/symbol.rb', line 15 def to_tex @symbol.to_s end |