Class: Ravelry::Category
- Inherits:
-
Object
- Object
- Ravelry::Category
- Defined in:
- lib/ravelry/category.rb
Overview
There is no API access point for PatternCategories. The information used to create ‘Ravelry::Category` comes from Pattern objects.
You should not create ‘Category` objects manually; they are all created–and owned by–by a Pattern.
See Pattern for more information about ‘Pattern` objects.
This does not inherit from Data because it doesn’t have a corresponding API endpoint.
Instance Attribute Summary collapse
-
#grandparent_name ⇒ Object
readonly
Returns the value of attribute grandparent_name.
-
#grandparent_permalink ⇒ Object
readonly
Returns the value of attribute grandparent_permalink.
-
#greatgrandparent_name ⇒ Object
readonly
Returns the value of attribute greatgrandparent_name.
-
#greatgrandparent_permalink ⇒ Object
readonly
Returns the value of attribute greatgrandparent_permalink.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent_name ⇒ Object
readonly
Returns the value of attribute parent_name.
-
#parent_permalink ⇒ Object
readonly
Returns the value of attribute parent_permalink.
-
#permalink ⇒ Object
readonly
Returns the value of attribute permalink.
Instance Method Summary collapse
-
#initialize(category) ⇒ Category
constructor
Creates new ‘Category` from Ravelry API PatternCategories attributes up to the great grandparent level.
Constructor Details
#initialize(category) ⇒ Category
Creates new ‘Category` from Ravelry API PatternCategories attributes up to the great grandparent level
All class variables are readonly.
18 19 20 21 22 23 |
# File 'lib/ravelry/category.rb', line 18 def initialize(category) @name = category[:name] @permalink = category[:permalink] @category = category set_relatives end |
Instance Attribute Details
#grandparent_name ⇒ Object (readonly)
Returns the value of attribute grandparent_name.
12 13 14 |
# File 'lib/ravelry/category.rb', line 12 def grandparent_name @grandparent_name end |
#grandparent_permalink ⇒ Object (readonly)
Returns the value of attribute grandparent_permalink.
12 13 14 |
# File 'lib/ravelry/category.rb', line 12 def grandparent_permalink @grandparent_permalink end |
#greatgrandparent_name ⇒ Object (readonly)
Returns the value of attribute greatgrandparent_name.
12 13 14 |
# File 'lib/ravelry/category.rb', line 12 def greatgrandparent_name @greatgrandparent_name end |
#greatgrandparent_permalink ⇒ Object (readonly)
Returns the value of attribute greatgrandparent_permalink.
12 13 14 |
# File 'lib/ravelry/category.rb', line 12 def greatgrandparent_permalink @greatgrandparent_permalink end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/ravelry/category.rb', line 12 def name @name end |
#parent_name ⇒ Object (readonly)
Returns the value of attribute parent_name.
12 13 14 |
# File 'lib/ravelry/category.rb', line 12 def parent_name @parent_name end |
#parent_permalink ⇒ Object (readonly)
Returns the value of attribute parent_permalink.
12 13 14 |
# File 'lib/ravelry/category.rb', line 12 def parent_permalink @parent_permalink end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
12 13 14 |
# File 'lib/ravelry/category.rb', line 12 def permalink @permalink end |