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.



30822
30823
30824
30825
30826
30827
30828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30822

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.



30820
30821
30822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30820

def description
  @description
end

#qObject (readonly)

Returns the value of attribute q.



30820
30821
30822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30820

def q
  @q
end

#regionsObject (readonly)

Returns the value of attribute regions.



30820
30821
30822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30820

def regions
  @regions
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30834
30835
30836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30834

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

#to_hashObject



30838
30839
30840
30841
30842
30843
30844
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30838

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

#to_jsonObject



30830
30831
30832
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30830

def to_json
  JSON.dump(to_hash)
end