Class: Io::Flow::V0::Models::IncludedLevies

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 = {}) ⇒ IncludedLevies

Returns a new instance of IncludedLevies.



14091
14092
14093
14094
14095
14096
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14091

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:key, :label], 'IncludedLevies')
  @key = (x = opts.delete(:key); x.is_a?(::Io::Flow::V0::Models::IncludedLevyKey) ? x : ::Io::Flow::V0::Models::IncludedLevyKey.apply(x))
  @label = HttpClient::Preconditions.assert_class('label', opts.delete(:label), String)
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



14089
14090
14091
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14089

def key
  @key
end

#labelObject (readonly)

Returns the value of attribute label.



14089
14090
14091
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14089

def label
  @label
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



14102
14103
14104
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14102

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

#to_hashObject



14106
14107
14108
14109
14110
14111
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14106

def to_hash
  {
    :key => key.value,
    :label => label
  }
end

#to_jsonObject



14098
14099
14100
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14098

def to_json
  JSON.dump(to_hash)
end