Class: Io::Flow::V0::Models::PricingSettings
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PricingSettings
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#default_duty_display ⇒ Object
readonly
Returns the value of attribute default_duty_display.
-
#default_tax_display ⇒ Object
readonly
Returns the value of attribute default_tax_display.
-
#editable ⇒ Object
readonly
Returns the value of attribute editable.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PricingSettings
constructor
A new instance of PricingSettings.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PricingSettings
45648 45649 45650 45651 45652 45653 45654 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45648 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:editable, :default_tax_display, :default_duty_display], 'PricingSettings') @editable = HttpClient::Preconditions.assert_boolean('editable', opts.delete(:editable)) @default_tax_display = (x = opts.delete(:default_tax_display); x.is_a?(::Io::Flow::V0::Models::PricingLevySetting) ? x : ::Io::Flow::V0::Models::PricingLevySetting.apply(x)) @default_duty_display = (x = opts.delete(:default_duty_display); x.is_a?(::Io::Flow::V0::Models::PricingLevySetting) ? x : ::Io::Flow::V0::Models::PricingLevySetting.apply(x)) end |
Instance Attribute Details
#default_duty_display ⇒ Object (readonly)
Returns the value of attribute default_duty_display.
45646 45647 45648 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45646 def default_duty_display @default_duty_display end |
#default_tax_display ⇒ Object (readonly)
Returns the value of attribute default_tax_display.
45646 45647 45648 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45646 def default_tax_display @default_tax_display end |
#editable ⇒ Object (readonly)
Returns the value of attribute editable.
45646 45647 45648 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45646 def editable @editable end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
45660 45661 45662 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45660 def copy(incoming={}) PricingSettings.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
45664 45665 45666 45667 45668 45669 45670 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45664 def to_hash { :editable => editable, :default_tax_display => default_tax_display.value, :default_duty_display => default_duty_display.value } end |
#to_json ⇒ Object
45656 45657 45658 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45656 def to_json JSON.dump(to_hash) end |