Class: Ruby::Tags::Void

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

Instance Method Summary collapse

Constructor Details

#initialize(name, attribute = Attribute.new) ⇒ Void

Returns a new instance of Void.



65
66
67
# File 'lib/ruby/tags/tags.rb', line 65

def initialize(name, attribute = Attribute.new)
  @name, @attribute = name, attribute
end

Instance Method Details

#==(other) ⇒ Object



73
74
75
76
# File 'lib/ruby/tags/tags.rb', line 73

def ==(other)
  @name == other.instance_variable_get(:@name) &&
  @attribute == other.instance_variable_get(:@attribute)
end

#renderObject



69
70
71
# File 'lib/ruby/tags/tags.rb', line 69

def render
  "<#{@name}#{@attribute.render}/>"
end