Class: Io::Flow::V0::Models::RepeatWeekly
- Inherits:
-
RepeatSchedule
- Object
- RepeatSchedule
- Io::Flow::V0::Models::RepeatWeekly
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#days_of_week ⇒ Object
readonly
Returns the value of attribute days_of_week.
-
#interval ⇒ Object
readonly
Returns the value of attribute interval.
Attributes inherited from RepeatSchedule
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ RepeatWeekly
constructor
A new instance of RepeatWeekly.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from RepeatSchedule
Constructor Details
#initialize(incoming = {}) ⇒ RepeatWeekly
Returns a new instance of RepeatWeekly.
47792 47793 47794 47795 47796 47797 47798 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47792 def initialize(incoming={}) super(:discriminator => RepeatSchedule::Types::REPEAT_WEEKLY) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:interval, :days_of_week], 'RepeatWeekly') @interval = HttpClient::Preconditions.assert_class('interval', opts.delete(:interval), Integer) @days_of_week = HttpClient::Preconditions.assert_class('days_of_week', opts.delete(:days_of_week), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DayOfWeek) ? x : ::Io::Flow::V0::Models::DayOfWeek.apply(x)) } end |
Instance Attribute Details
#days_of_week ⇒ Object (readonly)
Returns the value of attribute days_of_week.
47790 47791 47792 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47790 def days_of_week @days_of_week end |
#interval ⇒ Object (readonly)
Returns the value of attribute interval.
47790 47791 47792 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47790 def interval @interval end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
47804 47805 47806 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47804 def copy(incoming={}) RepeatWeekly.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
47808 47809 47810 47811 47812 47813 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47808 def subtype_to_hash { :interval => interval, :days_of_week => days_of_week.map { |o| o.value } } end |
#to_json ⇒ Object
47800 47801 47802 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47800 def to_json JSON.dump(to_hash) end |