Class: Pathtraq::Feed

Inherits:
Array
  • Object
show all
Defined in:
lib/pathtraq.rb

Direct Known Subclasses

CategoryRanking, KeywordSearch, NewsRanking

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Feed

Returns a new instance of Feed.



30
31
32
33
34
35
36
37
# File 'lib/pathtraq.rb', line 30

def initialize(data)
  __setobj__([])
  data.channel.items.each do |i|
    self << Item.new(i)
  end
  @title = data.title
  @link = data.link
end

Instance Attribute Details

Returns the value of attribute link.



28
29
30
# File 'lib/pathtraq.rb', line 28

def link
  @link
end

#titleObject (readonly)

Returns the value of attribute title.



27
28
29
# File 'lib/pathtraq.rb', line 27

def title
  @title
end

Class Method Details

.request(params = {}) ⇒ Object



22
23
24
25
# File 'lib/pathtraq.rb', line 22

def self.request(params = {})
  params ||= {}
  new(SimpleRSS.new(Request.new(self::URL, params).send))
end