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
Returns a new instance of PricingSettings.
42388 42389 42390 42391 42392 42393 42394 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42388 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.
42386 42387 42388 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42386 def default_duty_display @default_duty_display end |
#default_tax_display ⇒ Object (readonly)
Returns the value of attribute default_tax_display.
42386 42387 42388 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42386 def default_tax_display @default_tax_display end |
#editable ⇒ Object (readonly)
Returns the value of attribute editable.
42386 42387 42388 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42386 def editable @editable end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
42400 42401 42402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42400 def copy(incoming={}) PricingSettings.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
42404 42405 42406 42407 42408 42409 42410 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42404 def to_hash { :editable => editable, :default_tax_display => default_tax_display.value, :default_duty_display => default_duty_display.value } end |
#to_json ⇒ Object
42396 42397 42398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42396 def to_json JSON.dump(to_hash) end |