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.



65116
65117
65118
65119
65120
65121
65122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65116

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.



65114
65115
65116
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65114

def day_of_week
  @day_of_week
end

#hour_of_dayObject (readonly)

Returns the value of attribute hour_of_day.



65114
65115
65116
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65114

def hour_of_day
  @hour_of_day
end

#minute_of_hourObject (readonly)

Returns the value of attribute minute_of_hour.



65114
65115
65116
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65114

def minute_of_hour
  @minute_of_hour
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



65128
65129
65130
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65128

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

#to_hashObject



65132
65133
65134
65135
65136
65137
65138
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65132

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



65124
65125
65126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65124

def to_json
  JSON.dump(to_hash)
end