Class: Kriterion::Section

Inherits:
Object
  • Object
show all
Defined in:
lib/kriterion/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Object

#find_section, #to_h

Constructor Details

#initialize(data) ⇒ Section

Returns a new instance of Section.



13
14
15
16
17
18
19
20
21
22
# File 'lib/kriterion/section.rb', line 13

def initialize(data)
  @uuid        = data['uuid'] || SecureRandom.uuid
  @name        = data['name']
  @standard    = data['standard']
  @description = data['description']
  @items       = data['items'] || []
  @sections    = data['sections'] || []
  @parent_type = data['parent_type']
  @parent_uuid = data['parent_uuid']
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



9
10
11
# File 'lib/kriterion/section.rb', line 9

def description
  @description
end

#itemsObject

Returns the value of attribute items.



10
11
12
# File 'lib/kriterion/section.rb', line 10

def items
  @items
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/kriterion/section.rb', line 7

def name
  @name
end

#sectionsObject

Returns the value of attribute sections.



11
12
13
# File 'lib/kriterion/section.rb', line 11

def sections
  @sections
end

#standardObject

Returns the value of attribute standard.



8
9
10
# File 'lib/kriterion/section.rb', line 8

def standard
  @standard
end

#uuidObject

Returns the value of attribute uuid.



6
7
8
# File 'lib/kriterion/section.rb', line 6

def uuid
  @uuid
end

Instance Method Details

#complianceObject



28
29
30
# File 'lib/kriterion/section.rb', line 28

def compliance
  super([items, sections].flatten)
end

#typeObject



24
25
26
# File 'lib/kriterion/section.rb', line 24

def type
  :section
end