Class: Io::Flow::V0::Models::ExperiencePriceFacetConversionRequest

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

Returns a new instance of ExperiencePriceFacetConversionRequest.



32057
32058
32059
32060
32061
32062
32063
32064
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32057

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:boundary, :value, :base, :local], 'ExperiencePriceFacetConversionRequest')
  @boundary = (x = opts.delete(:boundary); x.is_a?(::Io::Flow::V0::Models::PriceFacetBoundary) ? x : ::Io::Flow::V0::Models::PriceFacetBoundary.apply(x))
  @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.



32055
32056
32057
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32055

def base
  @base
end

#boundaryObject (readonly)

Returns the value of attribute boundary.



32055
32056
32057
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32055

def boundary
  @boundary
end

#localObject (readonly)

Returns the value of attribute local.



32055
32056
32057
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32055

def local
  @local
end

#valueObject (readonly)

Returns the value of attribute value.



32055
32056
32057
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32055

def value
  @value
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32070
32071
32072
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32070

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

#to_hashObject



32074
32075
32076
32077
32078
32079
32080
32081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32074

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

#to_jsonObject



32066
32067
32068
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32066

def to_json
  JSON.dump(to_hash)
end