Class: OldPlaid::Category
- Inherits:
-
Object
- Object
- OldPlaid::Category
- Defined in:
- lib/old_plaid/models/category.rb
Instance Attribute Summary collapse
-
#hierarchy ⇒ Object
Returns the value of attribute hierarchy.
-
#id ⇒ Object
Returns the value of attribute id.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
-
.all(res) ⇒ Object
API: semi-private This method takes an array returned from the API and instantiates all of the categories.
Instance Method Summary collapse
-
#initialize(fields = {}) ⇒ Category
constructor
A new instance of Category.
Constructor Details
#initialize(fields = {}) ⇒ Category
Returns a new instance of Category.
5 6 7 8 9 |
# File 'lib/old_plaid/models/category.rb', line 5 def initialize(fields = {}) @type = fields['type'] @hierarchy = fields['hierarchy'] @id = fields['id'] end |
Instance Attribute Details
#hierarchy ⇒ Object
Returns the value of attribute hierarchy.
3 4 5 |
# File 'lib/old_plaid/models/category.rb', line 3 def hierarchy @hierarchy end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/old_plaid/models/category.rb', line 3 def id @id end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/old_plaid/models/category.rb', line 3 def type @type end |
Class Method Details
.all(res) ⇒ Object
API: semi-private This method takes an array returned from the API and instantiates all of the categories
13 14 15 |
# File 'lib/old_plaid/models/category.rb', line 13 def self.all(res) res.map { |cat| new(cat) } end |