Class: ButterCMS::PostsFetchService
- Inherits:
-
Object
- Object
- ButterCMS::PostsFetchService
- Defined in:
- lib/butter_cms/posts_fetch_service.rb
Instance Method Summary collapse
-
#initialize(request_options) ⇒ PostsFetchService
constructor
A new instance of PostsFetchService.
-
#more_posts? ⇒ Boolean
Returns true if the next page is available, false otherwise.
-
#posts ⇒ Array<ButterCMS::Post>
Returns array of post objects with the associated records included.
Constructor Details
#initialize(request_options) ⇒ PostsFetchService
Returns a new instance of PostsFetchService.
3 4 5 |
# File 'lib/butter_cms/posts_fetch_service.rb', line 3 def initialize() @request_options = end |
Instance Method Details
#more_posts? ⇒ Boolean
Returns true if the next page is available, false otherwise
19 20 21 |
# File 'lib/butter_cms/posts_fetch_service.rb', line 19 def more_posts? !parser.next_page.nil? end |
#posts ⇒ Array<ButterCMS::Post>
Returns array of post objects with the associated records included
10 11 12 13 14 |
# File 'lib/butter_cms/posts_fetch_service.rb', line 10 def posts parser.posts.map do |post_attributes| ::ButterCMS::Parsers::PostObject.call(post_attributes) end end |