mirror of
https://github.com/dkam/paapi.git
synced 2025-12-28 07:04:53 +00:00
Formatting fixes. Add more shortcuts
This commit is contained in:
@@ -9,10 +9,26 @@ module Paapi
|
|||||||
get(['ASIN'])
|
get(['ASIN'])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def detail_url
|
||||||
|
get(['DetailPageURL'])
|
||||||
|
end
|
||||||
|
|
||||||
|
def image_url
|
||||||
|
get(%w{Images Primary Large Height URL})
|
||||||
|
end
|
||||||
|
|
||||||
def title
|
def title
|
||||||
get(%w{ItemInfo Title DisplayValue})
|
get(%w{ItemInfo Title DisplayValue})
|
||||||
end
|
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
|
def release_date
|
||||||
get(%w{ItemInfo ReleaseDate})
|
get(%w{ItemInfo ReleaseDate})
|
||||||
end
|
end
|
||||||
@@ -33,12 +49,12 @@ module Paapi
|
|||||||
get(%w{ItemInfo ManufactureInfo ItemPartNumber DisplayValue})
|
get(%w{ItemInfo ManufactureInfo ItemPartNumber DisplayValue})
|
||||||
end
|
end
|
||||||
|
|
||||||
def format
|
def package
|
||||||
get(%w{ItemInfo TechnicalInfo Formats DisplayValues})
|
get(%w{ItemInfo TechnicalInfo Formats DisplayValues})
|
||||||
end
|
end
|
||||||
|
|
||||||
def kindle?
|
def kindle?
|
||||||
!format.nil? && format&.include?('Kindle eBook')
|
!package.nil? && package&.include?('Kindle eBook')
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(keys)
|
def get(keys)
|
||||||
|
|||||||
Reference in New Issue
Block a user