Class: Senkyoshi::ContentReviewedCriteria

Inherits:
RuleCriteria show all
Defined in:
lib/senkyoshi/models/content_reviewed_criteria.rb

Constant Summary

Constants inherited from RuleCriteria

RuleCriteria::COMPLETION_TYPES

Constants included from Senkyoshi

DIR_BASE, FILE_BASE, MAIN_CANVAS_MODULE, MASTER_MODULE, PRE_RESOURCE_TYPE, RESOURCE_TYPE, VERSION

Instance Attribute Summary collapse

Attributes inherited from RuleCriteria

#asidata_id, #content_id, #id, #negated

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RuleCriteria

#add_if_unique, #add_to_module_if_unique, #canvas_conversion, #get_id, get_id, get_negated, in_same_module?, #make_completion, #make_prereq, module_completion_requirement?, module_prerequisite?, #set_ids

Methods included from Senkyoshi

build_file, build_heirarchy, cleanup, configure, connect_content, create_canvas_course, create_random_hex, get_attribute_value, get_description, get_single_pre_data, get_text, initialize_course, iterate_files, iterate_xml, iterator_master, parse, parse_and_process_single, pre_iterator, read_file, reset, true?

Constructor Details

#initialize(id, negated, reviewed_content_id) ⇒ ContentReviewedCriteria

Returns a new instance of ContentReviewedCriteria.



22
23
24
25
# File 'lib/senkyoshi/models/content_reviewed_criteria.rb', line 22

def initialize(id, negated, reviewed_content_id)
  super(id, negated)
  @reviewed_content_id = reviewed_content_id
end

Instance Attribute Details

#reviewed_content_idObject (readonly)

Returns the value of attribute reviewed_content_id.



20
21
22
# File 'lib/senkyoshi/models/content_reviewed_criteria.rb', line 20

def reviewed_content_id
  @reviewed_content_id
end

Class Method Details

.from_xml(xml) ⇒ Object



27
28
29
30
31
32
# File 'lib/senkyoshi/models/content_reviewed_criteria.rb', line 27

def self.from_xml(xml)
  id = RuleCriteria.get_id xml
  negated = Senkyoshi.true? RuleCriteria.get_negated(xml)
  reviewed_content_id = xml.xpath("./REVIEWED_CONTENT_ID/@value").text
  ContentReviewedCriteria.new(id, negated, reviewed_content_id)
end

Instance Method Details

#get_completion_typeObject



38
39
40
# File 'lib/senkyoshi/models/content_reviewed_criteria.rb', line 38

def get_completion_type
  COMPLETION_TYPES[:must_view]
end

#get_foreign_idObject



34
35
36
# File 'lib/senkyoshi/models/content_reviewed_criteria.rb', line 34

def get_foreign_id
  @reviewed_content_id
end