Class: Tagline::Line

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/tagline/line.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Line

Returns a new instance of Line.



7
8
9
10
# File 'lib/tagline/line.rb', line 7

def initialize(text)
  @text = text
  @tags = Hash.new(false)
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



4
5
6
# File 'lib/tagline/line.rb', line 4

def text
  @text
end

Instance Method Details

#toggle(tag) ⇒ Object



12
13
14
# File 'lib/tagline/line.rb', line 12

def toggle(tag)
  self[tag] = !self[tag]
end