Class: LinkThumbnailer::Graders::HtmlAttribute
- Defined in:
- lib/link_thumbnailer/graders/html_attribute.rb
Instance Attribute Summary collapse
-
#attribute_name ⇒ Object
readonly
Returns the value of attribute attribute_name.
Attributes inherited from Base
#config, #description, #options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(description, attribute_name) ⇒ HtmlAttribute
constructor
A new instance of HtmlAttribute.
Methods inherited from Base
Constructor Details
#initialize(description, attribute_name) ⇒ HtmlAttribute
Returns a new instance of HtmlAttribute.
7 8 9 10 |
# File 'lib/link_thumbnailer/graders/html_attribute.rb', line 7 def initialize(description, attribute_name) super(description) @attribute_name = attribute_name.to_sym end |
Instance Attribute Details
#attribute_name ⇒ Object (readonly)
Returns the value of attribute attribute_name.
5 6 7 |
# File 'lib/link_thumbnailer/graders/html_attribute.rb', line 5 def attribute_name @attribute_name end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 |
# File 'lib/link_thumbnailer/graders/html_attribute.rb', line 12 def call return 1.0 if positive? return 0.0 if negative? 1.0 end |