Class: MiniHTML::AST::Attr

Inherits:
Base
  • Object
show all
Defined in:
lib/minihtml/ast/attr.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#original_token, #position_end, #position_start

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Attr

Returns a new instance of Attr.



9
10
11
12
13
# File 'lib/minihtml/ast/attr.rb', line 9

def initialize(token)
  super
  @name = token[:literal]
  @value = nil
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/minihtml/ast/attr.rb', line 6

def name
  @name
end

#valueObject

Returns the value of attribute value.



7
8
9
# File 'lib/minihtml/ast/attr.rb', line 7

def value
  @value
end