Class: Danica::Constant

Inherits:
Object
  • Object
show all
Defined in:
lib/danica/constant.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, latex, gnu) ⇒ Constant

Returns a new instance of Constant.



5
6
7
8
9
# File 'lib/danica/constant.rb', line 5

def initialize(value, latex, gnu)
  @value = value
  @latex = latex
  @gnu = gnu
end

Instance Attribute Details

#gnuObject (readonly)

Returns the value of attribute gnu.



3
4
5
# File 'lib/danica/constant.rb', line 3

def gnu
  @gnu
end

#latexObject (readonly)

Returns the value of attribute latex.



3
4
5
# File 'lib/danica/constant.rb', line 3

def latex
  @latex
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/danica/constant.rb', line 3

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
# File 'lib/danica/constant.rb', line 15

def ==(other)
  return false unless other.class == self.class
end

#to_fObject



11
12
13
# File 'lib/danica/constant.rb', line 11

def to_f
  value.to_f
end

#to_gnuObject



23
24
25
# File 'lib/danica/constant.rb', line 23

def to_gnu
  gnu.to_s
end

#to_texObject



19
20
21
# File 'lib/danica/constant.rb', line 19

def to_tex
  latex.to_s
end

#valued?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/danica/constant.rb', line 27

def valued?
  true
end