class AcademicBenchmarks::Standards::Document

Attributes

adopt_year[RW]
children[RW]
descr[RW]
description[RW]
guid[RW]
publication[RW]

Public Class Methods

from_hash(hash) click to toggle source
# 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
new(guid:, descr:, publication:, adopt_year:, children: []) click to toggle source
# 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

Private Instance Methods

attr_to_val_or_nil(klass, hash) click to toggle source
# File lib/academic_benchmarks/standards/document.rb, line 25
def attr_to_val_or_nil(klass, hash)
  return nil if hash.nil?
  klass.from_hash(hash)
end