Class: I18nYamlEditor::Category
- Inherits:
-
Object
- Object
- I18nYamlEditor::Category
- Defined in:
- lib/i18n_yaml_editor/category.rb
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
- #complete? ⇒ Boolean
-
#initialize(attributes = {}) ⇒ Category
constructor
A new instance of Category.
Constructor Details
#initialize(attributes = {}) ⇒ Category
Returns a new instance of Category.
9 10 11 12 |
# File 'lib/i18n_yaml_editor/category.rb', line 9 def initialize attributes={} @name = attributes[:name] @keys = Set.new end |
Instance Attribute Details
#keys ⇒ Object
Returns the value of attribute keys.
7 8 9 |
# File 'lib/i18n_yaml_editor/category.rb', line 7 def keys @keys end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/i18n_yaml_editor/category.rb', line 7 def name @name end |
Instance Method Details
#add_key(key) ⇒ Object
14 15 16 |
# File 'lib/i18n_yaml_editor/category.rb', line 14 def add_key key self.keys.add(key) end |
#complete? ⇒ Boolean
18 19 20 |
# File 'lib/i18n_yaml_editor/category.rb', line 18 def complete? self.keys.all? {|key| key.complete?} end |