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_s

Constructor Details

#initialize(title:, guid:) ⇒ Document

Returns a new instance of Document.



14
15
16
17
# File 'lib/academic_benchmarks/standards/document.rb', line 14

def initialize(title:, guid:)
  @title = title
  @guid = guid
end

Instance Attribute Details

#guidObject

Returns the value of attribute guid.



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

def guid
  @guid
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

Class Method Details

.from_hash(hash) ⇒ Object



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

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