Class: Io::Flow::V0::Models::ExclusionRulesExportType
- Inherits:
-
ExportType
- Object
- ExportType
- Io::Flow::V0::Models::ExclusionRulesExportType
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Defines the filters that can be applied when requesting an exclusion rule data export
Instance Attribute Summary collapse
-
#sort ⇒ Object
readonly
Returns the value of attribute sort.
-
#states ⇒ Object
readonly
Returns the value of attribute states.
Attributes inherited from ExportType
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ExclusionRulesExportType
constructor
A new instance of ExclusionRulesExportType.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ExportType
Constructor Details
#initialize(incoming = {}) ⇒ ExclusionRulesExportType
Returns a new instance of ExclusionRulesExportType.
41370 41371 41372 41373 41374 41375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41370 def initialize(incoming={}) super(:discriminator => ExportType::Types::EXCLUSION_RULES_EXPORT_TYPE) opts = HttpClient::Helper.symbolize_keys(incoming) @states = (x = opts.delete(:states); x.nil? ? nil : HttpClient::Preconditions.assert_class('states', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExclusionRuleState) ? x : ::Io::Flow::V0::Models::ExclusionRuleState.apply(x)) }) @sort = (x = opts.delete(:sort); x.nil? ? nil : HttpClient::Preconditions.assert_class('sort', x, String)) end |
Instance Attribute Details
#sort ⇒ Object (readonly)
Returns the value of attribute sort.
41368 41369 41370 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41368 def sort @sort end |
#states ⇒ Object (readonly)
Returns the value of attribute states.
41368 41369 41370 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41368 def states @states end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
41381 41382 41383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41381 def copy(incoming={}) ExclusionRulesExportType.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
41385 41386 41387 41388 41389 41390 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41385 def subtype_to_hash { :states => states.nil? ? nil : states.map { |o| o.value }, :sort => sort } end |
#to_json ⇒ Object
41377 41378 41379 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41377 def to_json JSON.dump(to_hash) end |