Class: FreeScrape::Category
- Inherits:
-
Object
- Object
- FreeScrape::Category
- Defined in:
- lib/free_scrape/category.rb
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Metadata associated with the category.
-
#name ⇒ Object
readonly
Name of the category.
Instance Method Summary collapse
-
#[](name) ⇒ Object
Returns the metadata with the specified name.
-
#initialize(name) ⇒ Category
constructor
Creates a new Category object with the specified name.
-
#to_s ⇒ Object
Returns the name of the category in
String
form.
Constructor Details
#initialize(name) ⇒ Category
Creates a new Category object with the specified name.
13 14 15 16 |
# File 'lib/free_scrape/category.rb', line 13 def initialize(name) @name = name @metadata = {} end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Metadata associated with the category
8 9 10 |
# File 'lib/free_scrape/category.rb', line 8 def @metadata end |
#name ⇒ Object (readonly)
Name of the category
5 6 7 |
# File 'lib/free_scrape/category.rb', line 5 def name @name end |
Instance Method Details
#[](name) ⇒ Object
Returns the metadata with the specified name.
21 22 23 |
# File 'lib/free_scrape/category.rb', line 21 def [](name) @metadata[name] end |
#to_s ⇒ Object
Returns the name of the category in String
form.
28 29 30 |
# File 'lib/free_scrape/category.rb', line 28 def to_s @name.to_s end |