Class: Worldline::Acquiring::SDK::V1::Domain::ByMerchantRootIds
- Inherits:
-
MerchantScope
- Object
- Domain::DataObject
- MerchantScope
- Worldline::Acquiring::SDK::V1::Domain::ByMerchantRootIds
- Defined in:
- lib/worldline/acquiring/sdk/v1/domain/by_merchant_root_ids.rb
Constant Summary collapse
- MERCHANT_SCOPE_TYPE =
'BY_MERCHANT_ROOT_IDS'.freeze
Instance Attribute Summary collapse
-
#merchant_root_ids ⇒ Array<Worldline::Acquiring::SDK::V1::Domain::MerchantRootIdItem>
The current value of merchant_root_ids.
Instance Method Summary collapse
- #from_hash(hash) ⇒ Object
-
#initialize ⇒ ByMerchantRootIds
constructor
A new instance of ByMerchantRootIds.
- #merchant_scope_type ⇒ String
- #to_h ⇒ Hash
Methods inherited from Domain::DataObject
Constructor Details
#initialize ⇒ ByMerchantRootIds
Returns a new instance of ByMerchantRootIds.
21 22 23 24 |
# File 'lib/worldline/acquiring/sdk/v1/domain/by_merchant_root_ids.rb', line 21 def initialize super @merchant_scope_type = MERCHANT_SCOPE_TYPE end |
Instance Attribute Details
#merchant_root_ids ⇒ Array<Worldline::Acquiring::SDK::V1::Domain::MerchantRootIdItem>
Returns the current value of merchant_root_ids.
13 14 15 |
# File 'lib/worldline/acquiring/sdk/v1/domain/by_merchant_root_ids.rb', line 13 def merchant_root_ids @merchant_root_ids end |
Instance Method Details
#from_hash(hash) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/worldline/acquiring/sdk/v1/domain/by_merchant_root_ids.rb', line 39 def from_hash(hash) super @merchant_scope_type = MERCHANT_SCOPE_TYPE if hash.has_key? 'merchantRootIds' raise TypeError, "value '%s' is not an Array" % [hash['merchantRootIds']] unless hash['merchantRootIds'].is_a? Array @merchant_root_ids = [] hash['merchantRootIds'].each do |e| @merchant_root_ids << Worldline::Acquiring::SDK::V1::Domain::MerchantRootIdItem.new_from_hash(e) end end end |
#merchant_scope_type ⇒ String
27 28 29 |
# File 'lib/worldline/acquiring/sdk/v1/domain/by_merchant_root_ids.rb', line 27 def merchant_scope_type MERCHANT_SCOPE_TYPE end |
#to_h ⇒ Hash
32 33 34 35 36 37 |
# File 'lib/worldline/acquiring/sdk/v1/domain/by_merchant_root_ids.rb', line 32 def to_h hash = super hash['merchantRootIds'] = @merchant_root_ids.collect{|val| val.to_h} unless @merchant_root_ids.nil? hash['merchantScopeType'] = MERCHANT_SCOPE_TYPE hash end |