Class: Io::Flow::V0::Models::OnboardingMerchantScheduledPickup

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 = {}) ⇒ OnboardingMerchantScheduledPickup

Returns a new instance of OnboardingMerchantScheduledPickup.



50811
50812
50813
50814
50815
50816
50817
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50811

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:day_of_week, :window], 'OnboardingMerchantScheduledPickup')
  @day_of_week = (x = opts.delete(:day_of_week); x.is_a?(::Io::Flow::V0::Models::DayOfWeek) ? x : ::Io::Flow::V0::Models::DayOfWeek.apply(x))
  @window = (x = opts.delete(:window); x.is_a?(::Io::Flow::V0::Models::OnboardingMerchantPickupWindow) ? x : ::Io::Flow::V0::Models::OnboardingMerchantPickupWindow.new(x))
  @instructions = (x = opts.delete(:instructions); x.nil? ? nil : HttpClient::Preconditions.assert_class('instructions', x, String))
end

Instance Attribute Details

#day_of_weekObject (readonly)

Returns the value of attribute day_of_week.



50809
50810
50811
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50809

def day_of_week
  @day_of_week
end

#instructionsObject (readonly)

Returns the value of attribute instructions.



50809
50810
50811
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50809

def instructions
  @instructions
end

#windowObject (readonly)

Returns the value of attribute window.



50809
50810
50811
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50809

def window
  @window
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50823
50824
50825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50823

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

#to_hashObject



50827
50828
50829
50830
50831
50832
50833
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50827

def to_hash
  {
    :day_of_week => day_of_week.value,
    :window => window.to_hash,
    :instructions => instructions
  }
end

#to_jsonObject



50819
50820
50821
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50819

def to_json
  JSON.dump(to_hash)
end