Class: AcademicBenchmarks::Standards::Section

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from InstVarsToHash

#to_h, #to_json, #to_s

Constructor Details

#initialize(guid:, descr:, children: []) ⇒ Section

Returns a new instance of Section.



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

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

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



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

def children
  @children
end

#descrObject Also known as: description

Returns the value of attribute descr.



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

def descr
  @descr
end

#guidObject

Returns the value of attribute guid.



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

def guid
  @guid
end

Class Method Details

.from_hash(hash) ⇒ Object



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

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