Class: Fotolia::Category
- Inherits:
-
Object
- Object
- Fotolia::Category
- Defined in:
- lib/fotolia/category.rb
Overview
Base class for ConceptualCategory and RepresentativeCategory.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
<Integer> The category’s id at Fotolia.
-
#key ⇒ Object
readonly
<String> Don’t know what this attribute means, but Fotolia’s API delivers it…
-
#name ⇒ Object
readonly
<String> The category’s name at Fotolia.
-
#parent_category ⇒ Object
readonly
<Category> The parent of this category or nil if any.
Instance Method Summary collapse
-
#initialize(fotolia_client, attributes) ⇒ Category
constructor
A new instance of Category.
Constructor Details
#initialize(fotolia_client, attributes) ⇒ Category
Returns a new instance of Category.
15 16 17 18 19 20 21 |
# File 'lib/fotolia/category.rb', line 15 def initialize(fotolia_client, attributes) @fotolia = fotolia_client @id = attributes['id'].to_i @name = attributes['name'] @parent_category = attributes['parent_category'] @key = attributes['key'] end |
Instance Attribute Details
#id ⇒ Object (readonly)
<Integer> The category’s id at Fotolia
7 8 9 |
# File 'lib/fotolia/category.rb', line 7 def id @id end |
#key ⇒ Object (readonly)
<String> Don’t know what this attribute means, but Fotolia’s API delivers it…
13 14 15 |
# File 'lib/fotolia/category.rb', line 13 def key @key end |
#name ⇒ Object (readonly)
<String> The category’s name at Fotolia. Should be translated to the language the used Fotolia::Base object is set to.
9 10 11 |
# File 'lib/fotolia/category.rb', line 9 def name @name end |
#parent_category ⇒ Object (readonly)
<Category> The parent of this category or nil if any.
11 12 13 |
# File 'lib/fotolia/category.rb', line 11 def parent_category @parent_category end |