Class: Fdlint::Parser::HTML::Property
- Includes:
- Matchable
- Defined in:
- lib/fdlint/parser/html/struct.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#sep ⇒ Object
readonly
Returns the value of attribute sep.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value, sep = '"') ⇒ Property
constructor
A new instance of Property.
- #position ⇒ Object
- #to_s ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
331 332 333 |
# File 'lib/fdlint/parser/html/struct.rb', line 331 def name @name end |
#sep ⇒ Object (readonly)
Returns the value of attribute sep.
331 332 333 |
# File 'lib/fdlint/parser/html/struct.rb', line 331 def sep @sep end |
#value ⇒ Object
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
#position ⇒ Object
338 |
# File 'lib/fdlint/parser/html/struct.rb', line 338 def position; name.position; end |
#to_s ⇒ Object
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 |