mirror of
https://github.com/dkam/paapi.git
synced 2025-12-28 07:04:53 +00:00
Method to get width, height, depth and weight from item. Bump gem version
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
## 0.0.6
|
||||
- Handle more date parsing failures.
|
||||
- Get width, height, depth and weight from items
|
||||
## 0.0.5
|
||||
|
||||
- Merged pull request #3 allowing options to be passed into the get_items and get_variations request
|
||||
|
||||
@@ -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