Class: Worldline::Acquiring::SDK::V1::Domain::MerchantData

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#addressString



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 18

def address
  @address
end

#cityString



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 18

def city
  @city
end

#country_codeString



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 18

def country_code
  @country_code
end

#merchant_category_codeInteger



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 18

def merchant_category_code
  @merchant_category_code
end

#nameString



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 18

def name
  @name
end

#postal_codeString



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 18

def postal_code
  @postal_code
end

#state_codeString



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 18

def state_code
  @state_code
end

Instance Method Details

#from_hash(hash) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 47

def from_hash(hash)
  super
  if hash.has_key? 'address'
    @address = hash['address']
  end
  if hash.has_key? 'city'
    @city = hash['city']
  end
  if hash.has_key? 'countryCode'
    @country_code = hash['countryCode']
  end
  if hash.has_key? 'merchantCategoryCode'
    @merchant_category_code = hash['merchantCategoryCode']
  end
  if hash.has_key? 'name'
    @name = hash['name']
  end
  if hash.has_key? 'postalCode'
    @postal_code = hash['postalCode']
  end
  if hash.has_key? 'stateCode'
    @state_code = hash['stateCode']
  end
end

#to_hHash



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 35

def to_h
  hash = super
  hash['address'] = @address unless @address.nil?
  hash['city'] = @city unless @city.nil?
  hash['countryCode'] = @country_code unless @country_code.nil?
  hash['merchantCategoryCode'] = @merchant_category_code unless @merchant_category_code.nil?
  hash['name'] = @name unless @name.nil?
  hash['postalCode'] = @postal_code unless @postal_code.nil?
  hash['stateCode'] = @state_code unless @state_code.nil?
  hash
end