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})
|
||||
end
|
||||
|
||||
def part_number
|
||||
get(%w{ItemInfo ManufactureInfo ItemPartNumber})
|
||||
end
|
||||
|
||||
def model
|
||||
get(%w{ItemInfo ManufactureInfo Model})
|
||||
end
|
||||
|
||||
def kindle?
|
||||
!package.nil? && package&.include?('Kindle eBook')
|
||||
end
|
||||
|
||||
@@ -19,6 +19,10 @@ module Paapi
|
||||
|
||||
end
|
||||
|
||||
def result_count
|
||||
@json.dig('SearchResult', 'TotalResultCount')
|
||||
end
|
||||
|
||||
def snake_case(s)
|
||||
return s.downcase if s.match(/\A[A-Z]+\z/)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user