Class: Category
- Inherits:
-
NesstarObject
- Object
- NesstarObject
- Category
- Defined in:
- lib/nesstar-api/category.rb
Overview
A category in a variable.
Categories have a name, a label, and a frequency
Instance Attribute Summary collapse
-
#frequency ⇒ Object
readonly
Returns the value of attribute frequency.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(data) ⇒ Category
constructor
A new instance of Category.
-
#missing? ⇒ Boolean
Returns true if this category is missing.
Constructor Details
#initialize(data) ⇒ Category
Returns a new instance of Category.
10 11 12 13 14 15 |
# File 'lib/nesstar-api/category.rb', line 10 def initialize(data) @label = data['label'] @value = data['value'] @frequency = data['frequency'] @missing = data['missing'] == 'true' end |
Instance Attribute Details
#frequency ⇒ Object (readonly)
Returns the value of attribute frequency.
8 9 10 |
# File 'lib/nesstar-api/category.rb', line 8 def frequency @frequency end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
8 9 10 |
# File 'lib/nesstar-api/category.rb', line 8 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/nesstar-api/category.rb', line 8 def name @name end |
Instance Method Details
#missing? ⇒ Boolean
Returns true if this category is missing
19 20 21 |
# File 'lib/nesstar-api/category.rb', line 19 def missing? @missing end |