Class: I18nYamlEditor::Category

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_yaml_editor/category.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keysObject

Returns the value of attribute keys.



7
8
9
# File 'lib/i18n_yaml_editor/category.rb', line 7

def keys
  @keys
end

#nameObject

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

Returns:

  • (Boolean)


18
19
20
# File 'lib/i18n_yaml_editor/category.rb', line 18

def complete?
  self.keys.all? {|key| key.complete?}
end