Class: Mathmas::Variable

Inherits:
Object
  • Object
show all
Includes:
Basic
Defined in:
lib/mathmas/core/symbol.rb

Overview

Class for Symbol like x, y, etc.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#symbolObject (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_sObject



11
12
13
# File 'lib/mathmas/core/symbol.rb', line 11

def to_s
  @symbol.to_s
end

#to_texObject



15
16
17
# File 'lib/mathmas/core/symbol.rb', line 15

def to_tex
  @symbol.to_s
end