Permalink
Browse files

allow package to be initialized in block, not just with option hash

  • Loading branch information...
1 parent 3901ddd commit a9e776963d176a8cc105ed5aa095cc815045aad4 Nicholas Yianilos committed Sep 13, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/usps/request/package/base.rb
View
4 lib/usps/request/package/base.rb
@@ -15,12 +15,12 @@ def initialize(fields)
if fields[:size] == 'LARGE'
[:container, :width, :length, :height].each do |field|
- error "#{field} is required when Size=LARGE" unless fields[field]
+ error "#{field} is required when Size=LARGE" unless send(field)
end
end
@@required.each do |field|
- error "#{field} is required" unless fields[field]
+ error "#{field} is required" unless send(field)
end
end

0 comments on commit a9e7769

Please sign in to comment.