mirror of
https://github.com/dkam/paapi.git
synced 2025-12-28 15:14:52 +00:00
Some more helpers
This commit is contained in:
@@ -105,6 +105,14 @@ module Paapi
|
|||||||
get(%w{ItemInfo TechnicalInfo Formats DisplayValues})
|
get(%w{ItemInfo TechnicalInfo Formats DisplayValues})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def part_number
|
||||||
|
get(%w{ItemInfo ManufactureInfo ItemPartNumber})
|
||||||
|
end
|
||||||
|
|
||||||
|
def model
|
||||||
|
get(%w{ItemInfo ManufactureInfo Model})
|
||||||
|
end
|
||||||
|
|
||||||
def kindle?
|
def kindle?
|
||||||
!package.nil? && package&.include?('Kindle eBook')
|
!package.nil? && package&.include?('Kindle eBook')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ module Paapi
|
|||||||
@items = @items_data.map {|d| Item.new(d)}
|
@items = @items_data.map {|d| Item.new(d)}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def result_count
|
||||||
|
@json.dig('SearchResult', 'TotalResultCount')
|
||||||
|
end
|
||||||
|
|
||||||
def snake_case(s)
|
def snake_case(s)
|
||||||
return s.downcase if s.match(/\A[A-Z]+\z/)
|
return s.downcase if s.match(/\A[A-Z]+\z/)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user