class Genba::OrderRequest
Public Class Methods
new()
click to toggle source
# File lib/genba/order_request.rb, line 5 def initialize @schema = Dry::Validation.Schema do required(:ClientTransactionID).filled(:str?) optional(:Properties).schema do required(:Sku).filled(:str?) optional(:BuyingPrice).schema do required(:Amount).filled(:float?) required(:CurrencyCode).filled(:str?) end required(:SellingPrice).schema do required(:NetAmount).filled(:float?) required(:GrossAmount).filled(:float?) required(:CurrencyCode).filled(:str?) end optional(:ConsumerIP).maybe(:str?) required(:CountryCode).filled(:str?) optional(:EtailerID).filled(:str?) end optional(:ReservationID).filled(:str?) end end
Public Instance Methods
call(data)
click to toggle source
# File lib/genba/order_request.rb, line 27 def call(data) @schema.call(data) end