Class: Jiragit::Tag
- Inherits:
-
Object
- Object
- Jiragit::Tag
- Defined in:
- lib/jiragit/tag.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(hashtag) ⇒ Tag
constructor
A new instance of Tag.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(hashtag) ⇒ Tag
Returns a new instance of Tag.
7 8 9 10 |
# File 'lib/jiragit/tag.rb', line 7 def initialize(hashtag) @type = hashtag.first.first.to_sym @label = hashtag.first.last.to_s end |
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label.
5 6 7 |
# File 'lib/jiragit/tag.rb', line 5 def label @label end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/jiragit/tag.rb', line 5 def type @type end |
Instance Method Details
#eql?(other) ⇒ Boolean
24 25 26 |
# File 'lib/jiragit/tag.rb', line 24 def eql?(other) other.to_s.hash == to_s.hash end |
#hash ⇒ Object
20 21 22 |
# File 'lib/jiragit/tag.rb', line 20 def hash to_s.hash end |
#inspect ⇒ Object
16 17 18 |
# File 'lib/jiragit/tag.rb', line 16 def inspect to_s end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/jiragit/tag.rb', line 12 def to_s "#{type}: #{label}" end |