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.



26047
26048
26049
26050
26051
26052
26053
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26047

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.



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

def day_of_week
  @day_of_week
end

#hour_of_dayObject (readonly)

Returns the value of attribute hour_of_day.



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

def hour_of_day
  @hour_of_day
end

#minute_of_hourObject (readonly)

Returns the value of attribute minute_of_hour.



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

def minute_of_hour
  @minute_of_hour
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26059
26060
26061
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26059

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

#to_hashObject



26063
26064
26065
26066
26067
26068
26069
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26063

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



26055
26056
26057
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26055

def to_json
  JSON.dump(to_hash)
end