Class: Revolut::Api::Response::Merchant

Inherits:
Object
  • Object
show all
Defined in:
lib/revolut/api/response/merchant.rb

Constant Summary collapse

MAPPING =
{
  "id"            =>  :id,
  "scheme"        =>  :scheme,
  "name"          =>  :name,
  "mcc"           =>  :mcc,
  "country"       =>  :country,
  "state"         =>  :state,
  "city"          =>  :city,
  "postcode"      =>  :postcode,
  "address"       =>  :address,
  "category"      =>  :category,
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ Merchant

Returns a new instance of Merchant.



21
22
23
24
25
# File 'lib/revolut/api/response/merchant.rb', line 21

def initialize(hash = {})
  ::Revolut::Api::Response::Merchant::MAPPING.each do |revolut_key, accessor|
    self.send("#{accessor}=", hash.fetch(revolut_key, nil))
  end
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



6
7
8
# File 'lib/revolut/api/response/merchant.rb', line 6

def address
  @address
end

#categoryObject

Returns the value of attribute category.



6
7
8
# File 'lib/revolut/api/response/merchant.rb', line 6

def category
  @category
end

#cityObject

Returns the value of attribute city.



6
7
8
# File 'lib/revolut/api/response/merchant.rb', line 6

def city
  @city
end

#countryObject

Returns the value of attribute country.



6
7
8
# File 'lib/revolut/api/response/merchant.rb', line 6

def country
  @country
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/revolut/api/response/merchant.rb', line 6

def id
  @id
end

#mappingObject

Returns the value of attribute mapping.



5
6
7
# File 'lib/revolut/api/response/merchant.rb', line 5

def mapping
  @mapping
end

#mccObject

Returns the value of attribute mcc.



6
7
8
# File 'lib/revolut/api/response/merchant.rb', line 6

def mcc
  @mcc
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/revolut/api/response/merchant.rb', line 6

def name
  @name
end

#postcodeObject

Returns the value of attribute postcode.



6
7
8
# File 'lib/revolut/api/response/merchant.rb', line 6

def postcode
  @postcode
end

#schemeObject

Returns the value of attribute scheme.



6
7
8
# File 'lib/revolut/api/response/merchant.rb', line 6

def scheme
  @scheme
end

#stateObject

Returns the value of attribute state.



6
7
8
# File 'lib/revolut/api/response/merchant.rb', line 6

def state
  @state
end