Class: Threesixtyvoice::Popular

Inherits:
Object
  • Object
show all
Defined in:
lib/threesixtyvoice/popular.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doc) ⇒ Popular

Returns a new instance of Popular.



5
6
7
8
9
10
# File 'lib/threesixtyvoice/popular.rb', line 5

def initialize(doc)
  @version = doc.xpath('//api/info/version').text
  @popular_blogs = doc.xpath('//api/mostpopular/gamer').map do |i|
    PopularBlog.new(i.xpath('rank').text, i.xpath('gamertag').text,i.xpath('url').text)
  end
end

Instance Attribute Details

Returns the value of attribute popular_blogs.



3
4
5
# File 'lib/threesixtyvoice/popular.rb', line 3

def popular_blogs
  @popular_blogs
end

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'lib/threesixtyvoice/popular.rb', line 3

def version
  @version
end