Class: Io::Flow::V0::Models::RemoteAreaServiceFee
- Inherits:
-
ServiceFee
- Object
- ServiceFee
- Io::Flow::V0::Models::RemoteAreaServiceFee
- 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 ServiceFee
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ RemoteAreaServiceFee
constructor
A new instance of RemoteAreaServiceFee.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ServiceFee
Constructor Details
#initialize(incoming = {}) ⇒ RemoteAreaServiceFee
Returns a new instance of RemoteAreaServiceFee.
47678 47679 47680 47681 47682 47683 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47678 def initialize(incoming={}) super(:discriminator => ServiceFee::Types::REMOTE_AREA_SERVICE_FEE) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:amount], 'RemoteAreaServiceFee') @amount = (x = opts.delete(:amount); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
47676 47677 47678 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47676 def amount @amount end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
47689 47690 47691 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47689 def copy(incoming={}) RemoteAreaServiceFee.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
47693 47694 47695 47696 47697 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47693 def subtype_to_hash { :amount => amount.to_hash } end |
#to_json ⇒ Object
47685 47686 47687 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47685 def to_json JSON.dump(to_hash) end |