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.



31846
31847
31848
31849
31850
31851
31852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31846

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.



31844
31845
31846
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31844

def description
  @description
end

#qObject (readonly)

Returns the value of attribute q.



31844
31845
31846
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31844

def q
  @q
end

#regionsObject (readonly)

Returns the value of attribute regions.



31844
31845
31846
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31844

def regions
  @regions
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



31858
31859
31860
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31858

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

#to_hashObject



31862
31863
31864
31865
31866
31867
31868
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31862

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

#to_jsonObject



31854
31855
31856
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31854

def to_json
  JSON.dump(to_hash)
end