Class: Contraption::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/contraption/tag.rb

Instance Method Summary collapse

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_sObject



7
8
9
# File 'lib/contraption/tag.rb', line 7

def to_s
  @display_text
end

#to_symObject



16
17
18
# File 'lib/contraption/tag.rb', line 16

def to_sym
  @display_text.to_sym
end

#to_urlObject



11
12
13
14
# File 'lib/contraption/tag.rb', line 11

def to_url
  @display_text.downcase
               .gsub ' ', '-'
end