Class: Io::Flow::V0::Models::ScheduledPickup
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ScheduledPickup
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#day_of_week ⇒ Object
readonly
Returns the value of attribute day_of_week.
-
#hour_of_day ⇒ Object
readonly
Returns the value of attribute hour_of_day.
-
#minute_of_hour ⇒ Object
readonly
Returns the value of attribute minute_of_hour.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ScheduledPickup
constructor
A new instance of ScheduledPickup.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ScheduledPickup
Returns a new instance of ScheduledPickup.
20008 20009 20010 20011 20012 20013 20014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20008 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_week ⇒ Object (readonly)
Returns the value of attribute day_of_week.
20006 20007 20008 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20006 def day_of_week @day_of_week end |
#hour_of_day ⇒ Object (readonly)
Returns the value of attribute hour_of_day.
20006 20007 20008 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20006 def hour_of_day @hour_of_day end |
#minute_of_hour ⇒ Object (readonly)
Returns the value of attribute minute_of_hour.
20006 20007 20008 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20006 def minute_of_hour @minute_of_hour end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
20020 20021 20022 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20020 def copy(incoming={}) ScheduledPickup.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
20024 20025 20026 20027 20028 20029 20030 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20024 def to_hash { :day_of_week => day_of_week.value, :hour_of_day => hour_of_day, :minute_of_hour => minute_of_hour } end |
#to_json ⇒ Object
20016 20017 20018 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20016 def to_json JSON.dump(to_hash) end |