Class: AcademicBenchmarks::Standards::Authority

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from InstVarsToHash

#to_h, #to_s

Constructor Details

#initialize(code:, guid:, description:) ⇒ Authority

Returns a new instance of Authority.



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

def initialize(code:, guid:, description:)
  @code = code
  @guid = guid
  @description = description
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



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

def code
  @code
end

#descriptionObject Also known as: descr

Returns the value of attribute description.



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

def description
  @description
end

#guidObject

Returns the value of attribute guid.



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

def guid
  @guid
end

Class Method Details

.from_hash(hash) ⇒ Object



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

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