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.
9 10 11 12 |
# File 'lib/link_thumbnailer/graders/html_attribute.rb', line 9 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.
7 8 9 |
# File 'lib/link_thumbnailer/graders/html_attribute.rb', line 7 def attribute_name @attribute_name end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 |
# File 'lib/link_thumbnailer/graders/html_attribute.rb', line 14 def call return 1.0 if positive? return 0.0 if negative? 1.0 end |