Class: AcademicBenchmarks::Standards::Document

Inherits:
Object
  • Object
show all
Includes:
InstVarsToHash
Defined in:
lib/academic_benchmarks/standards/document.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:, publication:, adopt_year:, children: []) ⇒ Document

Returns a new instance of Document.



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

def initialize(guid:, descr:, publication:, adopt_year:, children: [])
  @guid = guid
  @descr = descr
  @publication = attr_to_val_or_nil(Publication, publication)
  @adopt_year = adopt_year
  @children = children
end

Instance Attribute Details

#adopt_yearObject

Returns the value of attribute adopt_year.



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

def adopt_year
  @adopt_year
end

#childrenObject

Returns the value of attribute children.



8
9
10
# File 'lib/academic_benchmarks/standards/document.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/document.rb', line 8

def descr
  @descr
end

#guidObject

Returns the value of attribute guid.



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

def guid
  @guid
end

#publicationObject

Returns the value of attribute publication.



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

def publication
  @publication
end

Class Method Details

.from_hash(hash) ⇒ Object



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

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