Class: Contraption::Tag
- Inherits:
-
Object
- Object
- Contraption::Tag
- Defined in:
- lib/contraption/tag.rb
Instance Method Summary collapse
-
#initialize(text) ⇒ Tag
constructor
A new instance of Tag.
- #to_s ⇒ Object
- #to_sym ⇒ Object
- #to_url ⇒ Object
Constructor Details
#initialize(text) ⇒ Tag
3 4 5 |
# File 'lib/contraption/tag.rb', line 3 def initialize text @display_text = text.to_s end |
Instance Method Details
#to_s ⇒ Object
7 8 9 |
# File 'lib/contraption/tag.rb', line 7 def to_s @display_text end |
#to_sym ⇒ Object
16 17 18 |
# File 'lib/contraption/tag.rb', line 16 def to_sym @display_text.to_sym end |
#to_url ⇒ Object
11 12 13 14 |
# File 'lib/contraption/tag.rb', line 11 def to_url @display_text.downcase .gsub ' ', '-' end |