mirror of
https://github.com/dkam/paapi.git
synced 2025-12-28 15:14:52 +00:00
Method to get width, height, depth and weight from item. Bump gem version
This commit is contained in:
@@ -122,6 +122,26 @@ module Paapi
|
||||
get(%w{ItemInfo TechnicalInfo Formats DisplayValues})
|
||||
end
|
||||
|
||||
def height
|
||||
data = get(%w{ItemInfo ProductInfo ItemDimensions Height})
|
||||
[data.dig('DisplayValue'), data.dig('Unit')].join(' ')
|
||||
end
|
||||
|
||||
def length
|
||||
data = get(%w{ItemInfo ProductInfo ItemDimensions Length})
|
||||
[data.dig('DisplayValue'), data.dig('Unit')].join(' ')
|
||||
end
|
||||
|
||||
def width
|
||||
data = get(%w{ItemInfo ProductInfo ItemDimensions Width})
|
||||
[data.dig('DisplayValue'), data.dig('Unit')].join(' ')
|
||||
end
|
||||
|
||||
def weight
|
||||
data = get(%w{ItemInfo ProductInfo ItemDimensions Weight})
|
||||
[data.dig('DisplayValue'), data.dig('Unit')].join(' ')
|
||||
end
|
||||
|
||||
def kindle?
|
||||
!package.nil? && package&.include?('Kindle eBook')
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Paapi
|
||||
VERSION = '0.0.5'
|
||||
VERSION = '0.0.6'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user