Class: AcademicBenchmarks::Standards::Course

Inherits:
Object
  • Object
show all
Includes:
InstVarsToHash
Defined in:
lib/academic_benchmarks/standards/course.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:, description:) ⇒ Course

Returns a new instance of Course.



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

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

Instance Attribute Details

#descriptionObject Also known as: descr

Returns the value of attribute description.



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

def description
  @description
end

#guidObject

Returns the value of attribute guid.



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

def guid
  @guid
end

Class Method Details

.from_hash(hash) ⇒ Object



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

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