Class: Io::Flow::V0::Models::OnboardingMerchantPickupWindow

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OnboardingMerchantPickupWindow

Returns a new instance of OnboardingMerchantPickupWindow.



50783
50784
50785
50786
50787
50788
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50783

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:from, :to], 'OnboardingMerchantPickupWindow')
  @from = (x = opts.delete(:from); x.is_a?(::Io::Flow::V0::Models::OnboardingMerchantTime) ? x : ::Io::Flow::V0::Models::OnboardingMerchantTime.new(x))
  @to = (x = opts.delete(:to); x.is_a?(::Io::Flow::V0::Models::OnboardingMerchantTime) ? x : ::Io::Flow::V0::Models::OnboardingMerchantTime.new(x))
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



50781
50782
50783
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50781

def from
  @from
end

#toObject (readonly)

Returns the value of attribute to.



50781
50782
50783
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50781

def to
  @to
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50794
50795
50796
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50794

def copy(incoming={})
  OnboardingMerchantPickupWindow.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



50798
50799
50800
50801
50802
50803
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50798

def to_hash
  {
    :from => from.to_hash,
    :to => to.to_hash
  }
end

#to_jsonObject



50790
50791
50792
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50790

def to_json
  JSON.dump(to_hash)
end