Skip to content

Commit

Permalink
Merge pull request #4 from JuulLabs-OSS/alepore/default_values
Browse files Browse the repository at this point in the history
Set default values as callables
  • Loading branch information
alepore authored Sep 14, 2023
2 parents 70d0a9d + 4541664 commit a23797e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
we_ship_client (1.1.0)
we_ship_client (1.1.1)
activesupport
dry-struct (~> 1.4)
dry-types
Expand Down Expand Up @@ -94,6 +94,7 @@ GEM
zeitwerk (2.6.9)

PLATFORMS
arm64-darwin-21
arm64-darwin-22
x86_64-darwin-20
x86_64-darwin-21
Expand Down
2 changes: 1 addition & 1 deletion lib/we_ship_client/entities/order_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Entities
class OrderItem < Base
attribute :productName, Types::Strict::String
attribute :productSKU, Types::Strict::String
attribute :productType, Types::Strict::String.default(ENV['WE_SHIP_DEFAULT_PRODUCT_TYPE'])
attribute :productType, Types::Strict::String.default { ENV['WE_SHIP_DEFAULT_PRODUCT_TYPE'] }
attribute :quantity, Types::Strict::Integer
attribute :weight, Types::Strict::String
end
Expand Down
6 changes: 3 additions & 3 deletions lib/we_ship_client/entities/process_orders_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class ProcessOrdersRequest < Base
# :description=>"Invalid content was found starting with element 'clientCode'. One of '{order}' is expected.",
# :status=>"Fail"
# }}}
attribute :formatVersion, Types::Strict::String.default(ENV['WE_SHIP_FORMAT_VERSION'])
attribute :clientCode, Types::Strict::String.default(ENV['WE_SHIP_CUSTOMER_CODE'])
attribute :allowDuplicates, Types::Strict::String.default(ENV['WE_SHIP_ALLOW_DUPLICATES'])
attribute :formatVersion, Types::Strict::String.default { ENV['WE_SHIP_FORMAT_VERSION'] }
attribute :clientCode, Types::Strict::String.default { ENV['WE_SHIP_CUSTOMER_CODE'] }
attribute :allowDuplicates, Types::Strict::String.default { ENV['WE_SHIP_ALLOW_DUPLICATES'] }
attribute :order, Types::Strict::Array.of(Order)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/we_ship_client/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module WeShipClient
VERSION = '1.1.0'
VERSION = '1.1.1'
end

0 comments on commit a23797e

Please sign in to comment.