Class: Doconomy::Api::MerchantCategory
- Defined in:
- lib/doconomy/api/merchant_category.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
Attributes inherited from Base
Class Method Summary collapse
-
.all ⇒ Array<Doconomy::Api::MerchantCategory>
Returns all merchant categories.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ MerchantCategory
constructor
A new instance of MerchantCategory.
Methods inherited from Base
Constructor Details
#initialize(attributes = {}) ⇒ MerchantCategory
Returns a new instance of MerchantCategory.
8 9 10 11 |
# File 'lib/doconomy/api/merchant_category.rb', line 8 def initialize(attributes = {}) @attributes = attributes.deep_symbolize_keys @code = @attributes[:code] end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
6 7 8 |
# File 'lib/doconomy/api/merchant_category.rb', line 6 def code @code end |
Class Method Details
.all ⇒ Array<Doconomy::Api::MerchantCategory>
Returns all merchant categories
18 19 20 21 |
# File 'lib/doconomy/api/merchant_category.rb', line 18 def all response = client.get("/aland-index/#{Doconomy::Api.configuration.api_version}/merchant-categories") response[:merchant_categories].map { |attributes| new(attributes) } end |