Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to some new fields in v35. #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion lib/stamps/mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ class Rate < Hashie::Trash
property :WeightOz, :from => :weight_oz
property :PackageType, :from => :package_type
property :RequiresAllOf, :from => :requires_all
property :RequiresOneOf, :from => :requires_one_of
property :Length, :from => :length
property :Width, :from => :width
property :Height, :from => :height
property :ShipDate, :from => :ship_date
property :DeliveryDate, :from => :delivery_date
property :InsuredValue, :from => :insured_value
property :RegisteredValue, :from => :registration_value
property :CODValue, :from => :cod_value
Expand Down Expand Up @@ -108,9 +110,23 @@ class AddOn < Hashie::Trash
property :AddOnType, :from => :add_on_type
property :ProhibitedWithAnyOf, :from => :prohibited_with_any_of
property :MissingData, :from => :missing_data
property :RequiresAllOf, :from => :requires_all_of
def prohibited_with_any_of; end
def prohibited_with_any_of=(vals); end
property :RequiresAllOf, :from => :requires_all_of
def requires_all_of=(value)
self[:RequiresAllOf] = RequiresAllOf.new(value)
end
end

class RequiresAllOf < Hashie::Trash
property :RequiresOneOf, :from => :requires_one_of
def requires_one_of=(value)
self[:RequiresOneOf] = RequiresOneOf.new(value)
end
end

class RequiresOneOf < Hashie::Trash
property :AddOnTypeV5, :from => :add_on_type_v5
end

class Stamp < Hashie::Trash
Expand Down
2 changes: 1 addition & 1 deletion stamps.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('httpi', '~> 2.1.0')
s.add_runtime_dependency('json', '~> 1.0')
s.add_runtime_dependency('multi_json', '~> 1.0')
s.add_runtime_dependency('hashie', '~> 1.0.0')
s.add_runtime_dependency('hashie', '~> 1.2.0')

end