mirror of
https://github.com/dkam/paapi.git
synced 2025-12-28 15:14:52 +00:00
Formatting fixes. Add more shortcuts
This commit is contained in:
@@ -9,10 +9,26 @@ module Paapi
|
||||
get(['ASIN'])
|
||||
end
|
||||
|
||||
def detail_url
|
||||
get(['DetailPageURL'])
|
||||
end
|
||||
|
||||
def image_url
|
||||
get(%w{Images Primary Large Height URL})
|
||||
end
|
||||
|
||||
def title
|
||||
get(%w{ItemInfo Title DisplayValue})
|
||||
end
|
||||
|
||||
def contributors
|
||||
get(%w{ItemInfo ByLineInfo Contributors})
|
||||
end
|
||||
|
||||
def authors
|
||||
a = contributors.select { |e| e['Role'] == 'Author' }.map { |e| Nameable(e['Name'])}
|
||||
end
|
||||
|
||||
def release_date
|
||||
get(%w{ItemInfo ReleaseDate})
|
||||
end
|
||||
@@ -33,12 +49,12 @@ module Paapi
|
||||
get(%w{ItemInfo ManufactureInfo ItemPartNumber DisplayValue})
|
||||
end
|
||||
|
||||
def format
|
||||
def package
|
||||
get(%w{ItemInfo TechnicalInfo Formats DisplayValues})
|
||||
end
|
||||
|
||||
def kindle?
|
||||
!format.nil? && format&.include?('Kindle eBook')
|
||||
!package.nil? && package&.include?('Kindle eBook')
|
||||
end
|
||||
|
||||
def get(keys)
|
||||
|
||||
Reference in New Issue
Block a user