Class: AcademicBenchmarks::Standards::Document

Inherits:
Object
  • Object
show all
Includes:
InstVarsToHash, RemoveObsoleteChildren
Defined in:
lib/academic_benchmarks/standards/document.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RemoveObsoleteChildren

#remove_obsolete_children

Methods included from InstVarsToHash

#to_h, #to_json, #to_s

Constructor Details

#initialize(title:, guid:, children: []) ⇒ Document

Returns a new instance of Document.



16
17
18
19
20
# File 'lib/academic_benchmarks/standards/document.rb', line 16

def initialize(title:, guid:, children: [])
  @title = title
  @guid = guid
  @children = children
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



10
11
12
# File 'lib/academic_benchmarks/standards/document.rb', line 10

def children
  @children
end

#guidObject

Returns the value of attribute guid.



10
11
12
# File 'lib/academic_benchmarks/standards/document.rb', line 10

def guid
  @guid
end

#titleObject

Returns the value of attribute title.



10
11
12
# File 'lib/academic_benchmarks/standards/document.rb', line 10

def title
  @title
end

Class Method Details

.from_hash(hash) ⇒ Object



12
13
14
# File 'lib/academic_benchmarks/standards/document.rb', line 12

def self.from_hash(hash)
  self.new(title: hash["title"], guid: hash["guid"])
end