Class: ERBLint::Linters::StartTagHelper::Attribute
- Inherits:
-
Object
- Object
- ERBLint::Linters::StartTagHelper::Attribute
- Defined in:
- lib/erb_lint/linters/deprecated_classes.rb
Overview
Represents and provides an interface for an attribute found in a start tag in the HTML.
Constant Summary collapse
- ATTR_NAME_CLASS_PATTERN =
attribute names are case-insensitive
/\Aclass\z/i
Instance Attribute Summary collapse
-
#attribute_name ⇒ Object
Returns the value of attribute attribute_name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #class? ⇒ Boolean
-
#initialize(attribute_name, value) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(attribute_name, value) ⇒ Attribute
Returns a new instance of Attribute.
120 121 122 123 |
# File 'lib/erb_lint/linters/deprecated_classes.rb', line 120 def initialize(attribute_name, value) @attribute_name = attribute_name @value = value end |
Instance Attribute Details
#attribute_name ⇒ Object
Returns the value of attribute attribute_name.
118 119 120 |
# File 'lib/erb_lint/linters/deprecated_classes.rb', line 118 def attribute_name @attribute_name end |
#value ⇒ Object
Returns the value of attribute value.
118 119 120 |
# File 'lib/erb_lint/linters/deprecated_classes.rb', line 118 def value @value end |
Instance Method Details
#class? ⇒ Boolean
125 126 127 |
# File 'lib/erb_lint/linters/deprecated_classes.rb', line 125 def class? ATTR_NAME_CLASS_PATTERN.match(@attribute_name) end |