Class: Threesixtyvoice::BadgeList
- Inherits:
-
Object
- Object
- Threesixtyvoice::BadgeList
- Defined in:
- lib/threesixtyvoice/badge_list.rb
Instance Attribute Summary collapse
-
#badges ⇒ Object
readonly
Returns the value of attribute badges.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(doc) ⇒ BadgeList
constructor
A new instance of BadgeList.
Constructor Details
#initialize(doc) ⇒ BadgeList
Returns a new instance of BadgeList.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/threesixtyvoice/badge_list.rb', line 5 def initialize(doc) @version = doc.xpath('//api/info/version').text @title = doc.xpath('//api/info/title').text @badges = doc.xpath('//api/badges/badge').map do |i| Badge.new(i.xpath('id').text, i.xpath('title').text, i.xpath('owners').text, i.xpath('image').text, i.xpath('description').text, i.xpath("category").text, i.xpath("category_id").text, i.xpath('threshold').text, i.xpath('categoryname').text, i.xpath('badgescore_old').text, i.xpath('badgescore').text, i.xpath('badgescorecount').text ) end end |
Instance Attribute Details
#badges ⇒ Object (readonly)
Returns the value of attribute badges.
3 4 5 |
# File 'lib/threesixtyvoice/badge_list.rb', line 3 def badges @badges end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/threesixtyvoice/badge_list.rb', line 3 def title @title end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
3 4 5 |
# File 'lib/threesixtyvoice/badge_list.rb', line 3 def version @version end |