Class: Io::Flow::V0::Models::ExclusionRuleForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ExclusionRuleForm

Returns a new instance of ExclusionRuleForm.



41278
41279
41280
41281
41282
41283
41284
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41278

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:q, :regions], 'ExclusionRuleForm')
  @q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
  @regions = HttpClient::Preconditions.assert_class('regions', opts.delete(:regions), Array).map { |v| HttpClient::Preconditions.assert_class('regions', v, String) }
  @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



41276
41277
41278
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41276

def description
  @description
end

#qObject (readonly)

Returns the value of attribute q.



41276
41277
41278
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41276

def q
  @q
end

#regionsObject (readonly)

Returns the value of attribute regions.



41276
41277
41278
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41276

def regions
  @regions
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



41290
41291
41292
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41290

def copy(incoming={})
  ExclusionRuleForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



41294
41295
41296
41297
41298
41299
41300
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41294

def to_hash
  {
    :q => q,
    :regions => regions,
    :description => description
  }
end

#to_jsonObject



41286
41287
41288
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41286

def to_json
  JSON.dump(to_hash)
end