Class: AcademicBenchmarks::Standards::Document
- Inherits:
-
Object
- Object
- AcademicBenchmarks::Standards::Document
- Includes:
- InstVarsToHash
- Defined in:
- lib/academic_benchmarks/standards/document.rb
Instance Attribute Summary collapse
-
#adopt_year ⇒ Object
Returns the value of attribute adopt_year.
-
#children ⇒ Object
Returns the value of attribute children.
-
#descr ⇒ Object
(also: #description)
Returns the value of attribute descr.
-
#guid ⇒ Object
Returns the value of attribute guid.
-
#publication ⇒ Object
Returns the value of attribute publication.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(guid:, descr:, publication:, adopt_year:, children: []) ⇒ Document
constructor
A new instance of Document.
Methods included from InstVarsToHash
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_year ⇒ Object
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 |
#children ⇒ Object
Returns the value of attribute children.
8 9 10 |
# File 'lib/academic_benchmarks/standards/document.rb', line 8 def children @children end |
#descr ⇒ Object 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 |
#guid ⇒ Object
Returns the value of attribute guid.
8 9 10 |
# File 'lib/academic_benchmarks/standards/document.rb', line 8 def guid @guid end |
#publication ⇒ Object
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 |