Class: Io::Flow::V0::Models::ExperienceCurrencyFormat
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExperienceCurrencyFormat
- 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 = {}) ⇒ ExperienceCurrencyFormat
constructor
A new instance of ExperienceCurrencyFormat.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ExperienceCurrencyFormat
Returns a new instance of ExperienceCurrencyFormat.
18183 18184 18185 18186 18187 18188 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18183 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:symbol, :label_formatters], 'ExperienceCurrencyFormat') @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.
18181 18182 18183 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18181 def label_formatters @label_formatters end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
18181 18182 18183 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18181 def symbol @symbol end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
18194 18195 18196 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18194 def copy(incoming={}) ExperienceCurrencyFormat.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
18198 18199 18200 18201 18202 18203 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18198 def to_hash { :symbol => symbol.value, :label_formatters => label_formatters.map { |o| o.value } } end |
#to_json ⇒ Object
18190 18191 18192 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18190 def to_json JSON.dump(to_hash) end |