Class: Dino::Apis::News

Inherits:
Base
  • Object
show all
Defined in:
lib/dino/apis/news.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL

Instance Attribute Summary

Attributes inherited from Base

#client, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#fetch_data, #initialize

Constructor Details

This class inherits a constructor from Dino::Apis::Base

Class Method Details

.all(**args) ⇒ Object



4
5
6
# File 'lib/dino/apis/news.rb', line 4

def self.all(**args)
  new(**args)
end

Instance Method Details

#mapObject



8
9
10
11
12
13
14
# File 'lib/dino/apis/news.rb', line 8

def map
  return to_enum(__method__) unless block_given?

  response['Items'].map do |item|
    yield(Models::Item.new(item))
  end
end

#total_countObject



16
17
18
# File 'lib/dino/apis/news.rb', line 16

def total_count
  response['Total']
end