Class: Ruby::Tags::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby/tags/tags.rb

Instance Method Summary collapse

Constructor Details

#initialize(*tags) ⇒ Group

Returns a new instance of Group.



6
7
8
# File 'lib/ruby/tags/tags.rb', line 6

def initialize(*tags)
  @tags = tags
end

Instance Method Details

#==(other) ⇒ Object



19
20
21
# File 'lib/ruby/tags/tags.rb', line 19

def ==(other)
  @tags == other.instance_variable_get(:@tags)
end

#add(tag) ⇒ Object



14
15
16
17
# File 'lib/ruby/tags/tags.rb', line 14

def add(tag)
  @tags << tag
  self
end

#renderObject



10
11
12
# File 'lib/ruby/tags/tags.rb', line 10

def render
  @tags.map(&:render).join
end