Class: Io::Flow::V0::Models::ScheduledPickup

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

Returns a new instance of ScheduledPickup.



22685
22686
22687
22688
22689
22690
22691
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22685

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:day_of_week, :hour_of_day, :minute_of_hour], 'ScheduledPickup')
  @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))
  @hour_of_day = HttpClient::Preconditions.assert_class('hour_of_day', opts.delete(:hour_of_day), String)
  @minute_of_hour = HttpClient::Preconditions.assert_class('minute_of_hour', opts.delete(:minute_of_hour), String)
end

Instance Attribute Details

#day_of_weekObject (readonly)

Returns the value of attribute day_of_week.



22683
22684
22685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22683

def day_of_week
  @day_of_week
end

#hour_of_dayObject (readonly)

Returns the value of attribute hour_of_day.



22683
22684
22685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22683

def hour_of_day
  @hour_of_day
end

#minute_of_hourObject (readonly)

Returns the value of attribute minute_of_hour.



22683
22684
22685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22683

def minute_of_hour
  @minute_of_hour
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



22697
22698
22699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22697

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

#to_hashObject



22701
22702
22703
22704
22705
22706
22707
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22701

def to_hash
  {
    :day_of_week => day_of_week.value,
    :hour_of_day => hour_of_day,
    :minute_of_hour => minute_of_hour
  }
end

#to_jsonObject



22693
22694
22695
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22693

def to_json
  JSON.dump(to_hash)
end