Class: Constant

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-constants.rb

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Constant

Returns a new instance of Constant.



3
4
5
# File 'lib/ruby-constants.rb', line 3

def initialize(value)
  @val = value
end

Instance Method Details

#stringObject



11
12
13
# File 'lib/ruby-constants.rb', line 11

def string
  return @val
end

#typeObject



15
16
17
# File 'lib/ruby-constants.rb', line 15

def type
  return @val.class
end

#valueObject



7
8
9
# File 'lib/ruby-constants.rb', line 7

def value
  return @val
end