Class: FaceGroup::Feed

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

Overview

Group 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
17
# File 'lib/facegroup/feed.rb', line 10

def initialize(feed_data:)
  postings_data = feed_data['data']
  @postings = postings_data.map do |post_data|
    FaceGroup::Posting.new(data: post_data)
  end

  @pagination = feed_data['pagination']
end

Instance Attribute Details

#postingsObject (readonly)

Returns the value of attribute postings.



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

def postings
  @postings
end

Instance Method Details

#countObject



19
20
21
# File 'lib/facegroup/feed.rb', line 19

def count
  @postings.count
end