Class: OnlinePayments::SDK::Domain::AccountOnFileDisplayHints
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::AccountOnFileDisplayHints
- Defined in:
- lib/onlinepayments/sdk/domain/account_on_file_display_hints.rb
Instance Attribute Summary collapse
-
#label_template ⇒ Array<OnlinePayments::SDK::Domain::LabelTemplateElement>
The current value of label_template.
-
#logo ⇒ String
The current value of logo.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#label_template ⇒ Array<OnlinePayments::SDK::Domain::LabelTemplateElement>
Returns the current value of label_template.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/account_on_file_display_hints.rb', line 12 def label_template @label_template end |
#logo ⇒ String
Returns the current value of logo.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/account_on_file_display_hints.rb', line 12 def logo @logo end |
Instance Method Details
#from_hash(hash) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/onlinepayments/sdk/domain/account_on_file_display_hints.rb', line 24 def from_hash(hash) super if hash.key? 'labelTemplate' raise TypeError, "value '%s' is not an Array" % [hash['labelTemplate']] unless hash['labelTemplate'].is_a? Array @label_template = [] hash['labelTemplate'].each do |e| @label_template << OnlinePayments::SDK::Domain::LabelTemplateElement.new_from_hash(e) end end @logo = hash['logo'] if hash.key? 'logo' end |
#to_h ⇒ Hash
17 18 19 20 21 22 |
# File 'lib/onlinepayments/sdk/domain/account_on_file_display_hints.rb', line 17 def to_h hash = super hash['labelTemplate'] = @label_template.collect(&:to_h) if @label_template hash['logo'] = @logo unless @logo.nil? hash end |