Class: AcademicBenchmarks::Standards::Number

Inherits:
Object
  • Object
show all
Includes:
InstVarsToHash
Defined in:
lib/academic_benchmarks/standards/number.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(enhanced:, raw:) ⇒ Number

Returns a new instance of Number.



17
18
19
20
# File 'lib/academic_benchmarks/standards/number.rb', line 17

def initialize(enhanced:, raw:)
  @enhanced = enhanced
  @raw = raw
end

Instance Attribute Details

#enhancedObject

Returns the value of attribute enhanced.



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

def enhanced
  @enhanced
end

#rawObject

Returns the value of attribute raw.



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

def raw
  @raw
end

Class Method Details

.from_hash(hash) ⇒ Object



10
11
12
13
14
15
# File 'lib/academic_benchmarks/standards/number.rb', line 10

def self.from_hash(hash)
  self.new(
    enhanced: hash["enhanced"],
    raw: hash["raw"]
  )
end