Class: Io::Flow::V0::Models::AvailableFilterStructured
- Inherits:
-
AvailableFilter
- Object
- AvailableFilter
- Io::Flow::V0::Models::AvailableFilterStructured
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#operators ⇒ Object
readonly
Returns the value of attribute operators.
-
#placeholder ⇒ Object
readonly
Returns the value of attribute placeholder.
-
#valid_values ⇒ Object
readonly
Returns the value of attribute valid_values.
Attributes inherited from AvailableFilter
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AvailableFilterStructured
constructor
A new instance of AvailableFilterStructured.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from AvailableFilter
Constructor Details
#initialize(incoming = {}) ⇒ AvailableFilterStructured
Returns a new instance of AvailableFilterStructured.
27612 27613 27614 27615 27616 27617 27618 27619 27620 27621 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27612 def initialize(incoming={}) super(:discriminator => AvailableFilter::Types::AVAILABLE_FILTER_STRUCTURED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:field, :operators, :format], 'AvailableFilterStructured') @field = HttpClient::Preconditions.assert_class('field', opts.delete(:field), String) @operators = HttpClient::Preconditions.assert_class('operators', opts.delete(:operators), Array).map { |v| HttpClient::Preconditions.assert_class('operators', v, String) } @format = (x = opts.delete(:format); x.is_a?(::Io::Flow::V0::Models::AvailableFilterFormat) ? x : ::Io::Flow::V0::Models::AvailableFilterFormat.apply(x)) @valid_values = (x = opts.delete(:valid_values); x.nil? ? nil : HttpClient::Preconditions.assert_class('valid_values', x, Array).map { |v| HttpClient::Preconditions.assert_class('valid_values', v, String) }) @placeholder = (x = opts.delete(:placeholder); x.nil? ? nil : HttpClient::Preconditions.assert_class('placeholder', x, String)) end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
27610 27611 27612 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27610 def field @field end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
27610 27611 27612 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27610 def format @format end |
#operators ⇒ Object (readonly)
Returns the value of attribute operators.
27610 27611 27612 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27610 def operators @operators end |
#placeholder ⇒ Object (readonly)
Returns the value of attribute placeholder.
27610 27611 27612 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27610 def placeholder @placeholder end |
#valid_values ⇒ Object (readonly)
Returns the value of attribute valid_values.
27610 27611 27612 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27610 def valid_values @valid_values end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
27627 27628 27629 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27627 def copy(incoming={}) AvailableFilterStructured.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
27631 27632 27633 27634 27635 27636 27637 27638 27639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27631 def subtype_to_hash { :field => field, :operators => operators, :format => format.value, :valid_values => valid_values.nil? ? nil : valid_values, :placeholder => placeholder } end |
#to_json ⇒ Object
27623 27624 27625 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27623 def to_json JSON.dump(to_hash) end |