Class: Io::Flow::V0::Models::QueryFilterStructured
- Inherits:
-
QueryFilter
- Object
- QueryFilter
- Io::Flow::V0::Models::QueryFilterStructured
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#q ⇒ Object
readonly
Returns the value of attribute q.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Attributes inherited from QueryFilter
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ QueryFilterStructured
constructor
A new instance of QueryFilterStructured.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from QueryFilter
Constructor Details
#initialize(incoming = {}) ⇒ QueryFilterStructured
Returns a new instance of QueryFilterStructured.
45275 45276 45277 45278 45279 45280 45281 45282 45283 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45275 def initialize(incoming={}) super(:discriminator => QueryFilter::Types::QUERY_FILTER_STRUCTURED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:q, :field, :operator, :values], 'QueryFilterStructured') @q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String) @field = HttpClient::Preconditions.assert_class('field', opts.delete(:field), String) @operator = HttpClient::Preconditions.assert_class('operator', opts.delete(:operator), String) @values = HttpClient::Preconditions.assert_class('values', opts.delete(:values), Array).map { |v| HttpClient::Preconditions.assert_class('values', v, String) } end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
45273 45274 45275 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45273 def field @field end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
45273 45274 45275 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45273 def operator @operator end |
#q ⇒ Object (readonly)
Returns the value of attribute q.
45273 45274 45275 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45273 def q @q end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
45273 45274 45275 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45273 def values @values end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
45289 45290 45291 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45289 def copy(incoming={}) QueryFilterStructured.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
45293 45294 45295 45296 45297 45298 45299 45300 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45293 def subtype_to_hash { :q => q, :field => field, :operator => operator, :values => values } end |
#to_json ⇒ Object
45285 45286 45287 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45285 def to_json JSON.dump(to_hash) end |