Class: Locca::AuditResult

Inherits:
Object
  • Object
show all
Defined in:
lib/locca/audit_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection_name, lang) ⇒ AuditResult

Returns a new instance of AuditResult.



33
34
35
36
37
38
39
# File 'lib/locca/audit_result.rb', line 33

def initialize(collection_name, lang)
    @collection_name = collection_name 
    @lang = lang
    @untranslated_keys = []
    @missing_keys = []
    @extra_keys = []
end

Instance Attribute Details

#collection_nameObject (readonly)

Returns the value of attribute collection_name.



27
28
29
# File 'lib/locca/audit_result.rb', line 27

def collection_name
  @collection_name
end

#extra_keysObject

Returns the value of attribute extra_keys.



31
32
33
# File 'lib/locca/audit_result.rb', line 31

def extra_keys
  @extra_keys
end

#langObject (readonly)

Returns the value of attribute lang.



28
29
30
# File 'lib/locca/audit_result.rb', line 28

def lang
  @lang
end

#missing_keysObject

Returns the value of attribute missing_keys.



30
31
32
# File 'lib/locca/audit_result.rb', line 30

def missing_keys
  @missing_keys
end

#untranslated_keysObject (readonly)

Returns the value of attribute untranslated_keys.



29
30
31
# File 'lib/locca/audit_result.rb', line 29

def untranslated_keys
  @untranslated_keys
end

Instance Method Details

#add_untranslated_key(value) ⇒ Object



41
42
43
# File 'lib/locca/audit_result.rb', line 41

def add_untranslated_key(value)
    @untranslated_keys.push(value)
end

#passed?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/locca/audit_result.rb', line 45

def passed?
    return @untranslated_keys.empty? && @missing_keys.empty? && @extra_keys.empty?
end