Class: Io::Flow::V0::Models::ReturnPackageRatecardFee
- Inherits:
-
RatecardFee
- Object
- RatecardFee
- Io::Flow::V0::Models::ReturnPackageRatecardFee
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
Attributes inherited from RatecardFee
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ReturnPackageRatecardFee
constructor
A new instance of ReturnPackageRatecardFee.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from RatecardFee
Constructor Details
#initialize(incoming = {}) ⇒ ReturnPackageRatecardFee
Returns a new instance of ReturnPackageRatecardFee.
47306 47307 47308 47309 47310 47311 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47306 def initialize(incoming={}) super(:discriminator => RatecardFee::Types::RETURN_PACKAGE_RATECARD_FEE) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:amount], 'ReturnPackageRatecardFee') @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
47304 47305 47306 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47304 def amount @amount end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
47317 47318 47319 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47317 def copy(incoming={}) ReturnPackageRatecardFee.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
47321 47322 47323 47324 47325 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47321 def subtype_to_hash { :amount => amount.to_f.to_s } end |
#to_json ⇒ Object
47313 47314 47315 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47313 def to_json JSON.dump(to_hash) end |