Class: CommonCoreParser::Domain

Inherits:
Element show all
Defined in:
lib/common_core_parser/elements/domain.rb

Instance Attribute Summary

Attributes inherited from Element

#children_hash, #data

Instance Method Summary collapse

Methods inherited from Element

#add_child, #children, #code, #error_message, #grades, #illigit?, #initialize, #parent, #parent_ref_id, #ref_id, #statement, #to_s, #valid?, #valid_grades?

Constructor Details

This class inherits a constructor from CommonCoreParser::Element

Instance Method Details

#errorsObject



4
5
6
7
8
9
10
11
# File 'lib/common_core_parser/elements/domain.rb', line 4

def errors
  errors = []
  errors << 'Refid is blank' if ref_id.blank?
  errors << 'Code is blank' if code.blank?
  errors << 'Statement is blank' if statement.blank?
  errors << "invalid grades: #{grades}" unless valid_grades?
  return errors
end