Class: Io::Flow::V0::Models::PaymentMethodDataOptionLogo
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentMethodDataOptionLogo
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Direct Known Subclasses
PaymentMethodDataOptionLogoSvg, PaymentMethodDataOptionLogoUndefinedType
Defined Under Namespace
Modules: Types
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(incoming = {}) ⇒ PaymentMethodDataOptionLogo
constructor
A new instance of PaymentMethodDataOptionLogo.
- #subtype_to_hash ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PaymentMethodDataOptionLogo
Returns a new instance of PaymentMethodDataOptionLogo.
13961 13962 13963 13964 13965 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13961 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:type], 'PaymentMethodDataOptionLogo') @type = HttpClient::Preconditions.assert_class('type', opts.delete(:type), String) end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
13959 13960 13961 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13959 def type @type end |
Class Method Details
.from_json(hash) ⇒ Object
13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13975 def PaymentMethodDataOptionLogo.from_json(hash) HttpClient::Preconditions.assert_class('hash', hash, Hash) discriminator = HttpClient::Helper.symbolize_keys(hash)[:type].to_s.strip if discriminator.empty? raise "Union type[payment_method_data_option_logo] requires a field named 'type'" end case discriminator when Types::PAYMENT_METHOD_DATA_OPTION_LOGO_SVG; PaymentMethodDataOptionLogoSvg.new(hash) else PaymentMethodDataOptionLogoUndefinedType.new(:type => discriminator) end end |
Instance Method Details
#subtype_to_hash ⇒ Object
13967 13968 13969 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13967 def subtype_to_hash raise 'Cannot serialize an instance of payment_method_data_option_logo directly - must use one of the specific types: payment_method_data_option_logo_svg' end |
#to_hash ⇒ Object
13971 13972 13973 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13971 def to_hash subtype_to_hash.merge(:type => @type) end |