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