Class: FansWatch::Feed

Inherits:
Object
  • Object
show all
Defined in:
lib/fanswatch/feed.rb

Overview

Page feeds, with data and paging information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(feed_data:) ⇒ Feed

Returns a new instance of Feed.



10
11
12
13
14
15
16
# File 'lib/fanswatch/feed.rb', line 10

def initialize(feed_data:)
  raw_feed = FansWatch::FbApi.page_feed(feed_data)
  @postings = raw_feed.map do |post_data|
    FansWatch::Posting.new(data: post_data)
  end

end

Instance Attribute Details

#postingsObject (readonly)

Returns the value of attribute postings.



8
9
10
# File 'lib/fanswatch/feed.rb', line 8

def postings
  @postings
end

Instance Method Details

#countObject



18
19
20
# File 'lib/fanswatch/feed.rb', line 18

def count
  @postings.count
end