Class: Badge
- Inherits:
-
Object
- Object
- Badge
- Defined in:
- lib/codeschool/badge.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(dom) ⇒ Badge
constructor
A new instance of Badge.
Constructor Details
#initialize(dom) ⇒ Badge
Returns a new instance of Badge.
4 5 6 7 |
# File 'lib/codeschool/badge.rb', line 4 def initialize(dom) @name = dom.text.strip @image = dom.css('img').first.attributes['src'].value end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
2 3 4 |
# File 'lib/codeschool/badge.rb', line 2 def image @image end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/codeschool/badge.rb', line 2 def name @name end |