Class: Fotolia::Category
- Inherits:
-
Object
show all
- Defined in:
- lib/fotolia/category.rb
Overview
Base class for ConceptualCategory and RepresentativeCategory.
Instance Attribute Summary collapse
Instance Method Summary
collapse
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
The category's id at Fotolia
7
8
9
|
# File 'lib/fotolia/category.rb', line 7
def id
@id
end
|
#key ⇒ Object
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
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
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
|