Class: Dino::Apis::News
- Inherits:
-
Base
- Object
- Base
- Dino::Apis::News
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
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
#map ⇒ Object
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_count ⇒ Object
16
17
18
|
# File 'lib/dino/apis/news.rb', line 16
def total_count
response['Total']
end
|