Class: Campa::Symbol
- Inherits:
-
Object
- Object
- Campa::Symbol
- Defined in:
- lib/campa/symbol.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(label) ⇒ Symbol
constructor
A new instance of Symbol.
Constructor Details
#initialize(label) ⇒ Symbol
Returns a new instance of Symbol.
5 6 7 |
# File 'lib/campa/symbol.rb', line 5 def initialize(label) @label = label end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
3 4 5 |
# File 'lib/campa/symbol.rb', line 3 def label @label end |
Instance Method Details
#==(other) ⇒ Object
9 10 11 12 13 |
# File 'lib/campa/symbol.rb', line 9 def ==(other) return false if !other.is_a?(self.class) label == other.label end |
#eql?(other) ⇒ Boolean
15 16 17 |
# File 'lib/campa/symbol.rb', line 15 def eql?(other) self == other && hash == other.hash end |
#hash ⇒ Object
19 20 21 |
# File 'lib/campa/symbol.rb', line 19 def hash @hash ||= "Campa::Symbol_#{label}".hash end |