Class: ExaltedMath::Node::Number

Inherits:
ExaltedMath::Node show all
Defined in:
lib/exalted_math/node/number.rb

Instance Method Summary collapse

Methods inherited from ExaltedMath::Node

#simplify

Constructor Details

#initialize(value) ⇒ Number

Returns a new instance of Number.



6
7
8
# File 'lib/exalted_math/node/number.rb', line 6

def initialize(value)
  @value = value
end

Instance Method Details

#==(o) ⇒ Object



18
19
20
21
# File 'lib/exalted_math/node/number.rb', line 18

def ==(o)
  return false unless self.class === o
  @value == o.value
end

#constant?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/exalted_math/node/number.rb', line 10

def constant?
  true
end

#valid?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/exalted_math/node/number.rb', line 23

def valid?(*)
  true
end

#value(context = {}) ⇒ Object



14
15
16
# File 'lib/exalted_math/node/number.rb', line 14

def value(context={})
  @value
end