Class: Gammo::Tokenizer::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/gammo/tokenizer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, attributes: [], self_closing: false) ⇒ Tag

Returns a new instance of Tag.



213
214
215
216
217
# File 'lib/gammo/tokenizer.rb', line 213

def initialize(name:, attributes: [], self_closing: false)
  @name         = name
  @attributes   = attributes
  @self_closing = self_closing
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



211
212
213
# File 'lib/gammo/tokenizer.rb', line 211

def attributes
  @attributes
end

#nameObject

Returns the value of attribute name.



211
212
213
# File 'lib/gammo/tokenizer.rb', line 211

def name
  @name
end

#self_closingObject

Returns the value of attribute self_closing.



211
212
213
# File 'lib/gammo/tokenizer.rb', line 211

def self_closing
  @self_closing
end

Instance Method Details

#self_closing?Boolean

Returns:

  • (Boolean)


219
220
221
# File 'lib/gammo/tokenizer.rb', line 219

def self_closing?
  !!self_closing
end