Class: Klam::Constant

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Constant

Returns a new instance of Constant.



5
6
7
# File 'lib/klam/constant.rb', line 5

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



13
14
15
# File 'lib/klam/constant.rb', line 13

def ==(other)
  other.kind_of?(Constant) && name == other.name
end

#hashObject



17
18
19
# File 'lib/klam/constant.rb', line 17

def hash
  name.hash
end

#to_sObject



9
10
11
# File 'lib/klam/constant.rb', line 9

def to_s
  name
end