Class: AcademicBenchmarks::Standards::Subject

Inherits:
Object
  • Object
show all
Includes:
InstVarsToHash
Defined in:
lib/academic_benchmarks/standards/subject.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(code:, broad:) ⇒ Subject

Returns a new instance of Subject.



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

def initialize(code:, broad:)
  @code = code
  @broad = broad
end

Instance Attribute Details

#broadObject

Returns the value of attribute broad.



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

def broad
  @broad
end

#codeObject

Returns the value of attribute code.



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

def code
  @code
end

Class Method Details

.from_hash(hash) ⇒ Object



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

def self.from_hash(hash)
  self.new(code: hash["code"], broad: hash["broad"], )
end