Class: AcademicBenchmarks::Standards::Grade

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from InstVarsToHash

#to_h, #to_s

Constructor Details

#initialize(high:, low:) ⇒ Grade

Returns a new instance of Grade.



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

def initialize(high:, low:)
  @high = high
  @low = low
end

Instance Attribute Details

#highObject

Returns the value of attribute high.



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

def high
  @high
end

#lowObject

Returns the value of attribute low.



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

def low
  @low
end

Class Method Details

.from_hash(hash) ⇒ Object



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

def self.from_hash(hash)
  self.new(high: hash["high"], low: hash["low"])
end