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



26038
26039
26040
26041
26042
26043
26044
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26038

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.



26036
26037
26038
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26036

def day_of_week
  @day_of_week
end

#hour_of_dayObject (readonly)

Returns the value of attribute hour_of_day.



26036
26037
26038
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26036

def hour_of_day
  @hour_of_day
end

#minute_of_hourObject (readonly)

Returns the value of attribute minute_of_hour.



26036
26037
26038
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26036

def minute_of_hour
  @minute_of_hour
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26050
26051
26052
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26050

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

#to_hashObject



26054
26055
26056
26057
26058
26059
26060
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26054

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



26046
26047
26048
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26046

def to_json
  JSON.dump(to_hash)
end