Class: Io::Flow::V0::Models::ExperienceCurrencyFormatForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExperienceCurrencyFormatForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#label_formatters ⇒ Object
readonly
Returns the value of attribute label_formatters.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ExperienceCurrencyFormatForm
constructor
A new instance of ExperienceCurrencyFormatForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ExperienceCurrencyFormatForm
Returns a new instance of ExperienceCurrencyFormatForm.
31853 31854 31855 31856 31857 31858 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31853 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:symbol, :label_formatters], 'ExperienceCurrencyFormatForm') @symbol = (x = opts.delete(:symbol); x.is_a?(::Io::Flow::V0::Models::CurrencySymbolFormat) ? x : ::Io::Flow::V0::Models::CurrencySymbolFormat.apply(x)) @label_formatters = HttpClient::Preconditions.assert_class('label_formatters', opts.delete(:label_formatters), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::CurrencyLabelFormatter) ? x : ::Io::Flow::V0::Models::CurrencyLabelFormatter.apply(x)) } end |
Instance Attribute Details
#label_formatters ⇒ Object (readonly)
Returns the value of attribute label_formatters.
31851 31852 31853 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31851 def label_formatters @label_formatters end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
31851 31852 31853 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31851 def symbol @symbol end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
31864 31865 31866 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31864 def copy(incoming={}) ExperienceCurrencyFormatForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
31868 31869 31870 31871 31872 31873 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31868 def to_hash { :symbol => symbol.value, :label_formatters => label_formatters.map { |o| o.value } } end |
#to_json ⇒ Object
31860 31861 31862 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31860 def to_json JSON.dump(to_hash) end |