Class: I18nYamlEditor::Category
- Inherits:
-
Object
- Object
- I18nYamlEditor::Category
- Defined in:
- lib/i18n_yaml_editor/category.rb
Overview
This is a category
Instance Attribute Summary collapse
-
#keys ⇒ Object
Returns the value of attribute keys.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#add_key(key) ⇒ Object
Adds a given key to this category’s list of keys.
-
#complete? ⇒ true, false
Checks and returns if all keys are complete.
-
#initialize(attributes = {}) ⇒ Category
constructor
A new instance of Category.
Constructor Details
#initialize(attributes = {}) ⇒ Category
Returns a new instance of Category.
10 11 12 13 |
# File 'lib/i18n_yaml_editor/category.rb', line 10 def initialize(attributes = {}) @name = attributes[:name] @keys = Set.new end |
Instance Attribute Details
#keys ⇒ Object
Returns the value of attribute keys.
8 9 10 |
# File 'lib/i18n_yaml_editor/category.rb', line 8 def keys @keys end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/i18n_yaml_editor/category.rb', line 8 def name @name end |
Instance Method Details
#add_key(key) ⇒ Object
Adds a given key to this category’s list of keys
17 18 19 |
# File 'lib/i18n_yaml_editor/category.rb', line 17 def add_key(key) keys.add(key) end |
#complete? ⇒ true, false
Checks and returns if all keys are complete
23 24 25 |
# File 'lib/i18n_yaml_editor/category.rb', line 23 def complete? keys.all?(&:complete?) end |