Class: Fdlint::Parser::HTML::Property

Inherits:
Node
  • Object
show all
Includes:
Matchable
Defined in:
lib/fdlint/parser/html/struct.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Matchable

#=~

Constructor Details

#initialize(name, value, sep = '"') ⇒ Property

Returns a new instance of Property.



334
335
336
# File 'lib/fdlint/parser/html/struct.rb', line 334

def initialize(name, value, sep='"')
  @name, @value, @sep = name, value, sep
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



331
332
333
# File 'lib/fdlint/parser/html/struct.rb', line 331

def name
  @name
end

#sepObject (readonly)

Returns the value of attribute sep.



331
332
333
# File 'lib/fdlint/parser/html/struct.rb', line 331

def sep
  @sep
end

#valueObject

Returns the value of attribute value.



332
333
334
# File 'lib/fdlint/parser/html/struct.rb', line 332

def value
  @value
end

Instance Method Details

#positionObject



338
# File 'lib/fdlint/parser/html/struct.rb', line 338

def position; name.position; end

#to_sObject



340
341
342
343
344
345
346
# File 'lib/fdlint/parser/html/struct.rb', line 340

def to_s
  if value.nil?
    name.to_s
  else
    "#{name}=#{sep}#{value}#{sep}"
  end
end