Class: Io::Flow::V0::Models::ExperiencePriceConversionRequest

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

Returns a new instance of ExperiencePriceConversionRequest.



37361
37362
37363
37364
37365
37366
37367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37361

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:value, :base, :local], 'ExperiencePriceConversionRequest')
  @value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal)
  @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
  @local = HttpClient::Preconditions.assert_class('local', opts.delete(:local), String)
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



37359
37360
37361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37359

def base
  @base
end

#localObject (readonly)

Returns the value of attribute local.



37359
37360
37361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37359

def local
  @local
end

#valueObject (readonly)

Returns the value of attribute value.



37359
37360
37361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37359

def value
  @value
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37373
37374
37375
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37373

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

#to_hashObject



37377
37378
37379
37380
37381
37382
37383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37377

def to_hash
  {
    :value => value.to_f.to_s,
    :base => base,
    :local => local
  }
end

#to_jsonObject



37369
37370
37371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37369

def to_json
  JSON.dump(to_hash)
end