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.



48691
48692
48693
48694
48695
48696
48697
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48691

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.



48689
48690
48691
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48689

def day_of_week
  @day_of_week
end

#hour_of_dayObject (readonly)

Returns the value of attribute hour_of_day.



48689
48690
48691
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48689

def hour_of_day
  @hour_of_day
end

#minute_of_hourObject (readonly)

Returns the value of attribute minute_of_hour.



48689
48690
48691
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48689

def minute_of_hour
  @minute_of_hour
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



48703
48704
48705
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48703

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

#to_hashObject



48707
48708
48709
48710
48711
48712
48713
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48707

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



48699
48700
48701
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48699

def to_json
  JSON.dump(to_hash)
end