Class: Klam::Constant
- Inherits:
-
Object
- Object
- Klam::Constant
- Defined in:
- lib/klam/constant.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(name) ⇒ Constant
constructor
A new instance of Constant.
- #to_s ⇒ Object
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
#name ⇒ Object (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 |
#hash ⇒ Object
17 18 19 |
# File 'lib/klam/constant.rb', line 17 def hash name.hash end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/klam/constant.rb', line 9 def to_s name end |