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.
38151 38152 38153 38154 38155 38156 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38151 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.
38149 38150 38151 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38149 def sort @sort end |
#states ⇒ Object (readonly)
Returns the value of attribute states.
38149 38150 38151 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38149 def states @states end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
38162 38163 38164 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38162 def copy(incoming={}) ExclusionRulesExportType.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
38166 38167 38168 38169 38170 38171 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38166 def subtype_to_hash { :states => states.nil? ? nil : states.map { |o| o.value }, :sort => sort } end |
#to_json ⇒ Object
38158 38159 38160 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38158 def to_json JSON.dump(to_hash) end |