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.
60425 60426 60427 60428 60429 60430 60431 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60425 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.
60423 60424 60425 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60423 def day_of_week @day_of_week end |
#hour_of_day ⇒ Object (readonly)
Returns the value of attribute hour_of_day.
60423 60424 60425 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60423 def hour_of_day @hour_of_day end |
#minute_of_hour ⇒ Object (readonly)
Returns the value of attribute minute_of_hour.
60423 60424 60425 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60423 def minute_of_hour @minute_of_hour end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
60437 60438 60439 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60437 def copy(incoming={}) ScheduledPickup.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
60441 60442 60443 60444 60445 60446 60447 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60441 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
60433 60434 60435 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60433 def to_json JSON.dump(to_hash) end |