Class: AcademicBenchmarks::Standards::HasRelations
- Inherits:
-
Object
- Object
- AcademicBenchmarks::Standards::HasRelations
- Includes:
- InstVarsToHash
- Defined in:
- lib/academic_benchmarks/standards/has_relations.rb
Instance Attribute Summary collapse
-
#derivative ⇒ Object
Returns the value of attribute derivative.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#related_derivative ⇒ Object
Returns the value of attribute related_derivative.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(origin: 0, derivative: 0, related_derivative: 0) ⇒ HasRelations
constructor
A new instance of HasRelations.
Methods included from InstVarsToHash
Constructor Details
#initialize(origin: 0, derivative: 0, related_derivative: 0) ⇒ HasRelations
Returns a new instance of HasRelations.
14 15 16 17 18 |
# File 'lib/academic_benchmarks/standards/has_relations.rb', line 14 def initialize(origin: 0, derivative: 0, related_derivative: 0) @origin = origin @derivative = derivative @related_derivative = end |
Instance Attribute Details
#derivative ⇒ Object
Returns the value of attribute derivative.
8 9 10 |
# File 'lib/academic_benchmarks/standards/has_relations.rb', line 8 def derivative @derivative end |
#origin ⇒ Object
Returns the value of attribute origin.
8 9 10 |
# File 'lib/academic_benchmarks/standards/has_relations.rb', line 8 def origin @origin end |
#related_derivative ⇒ Object
Returns the value of attribute related_derivative.
8 9 10 |
# File 'lib/academic_benchmarks/standards/has_relations.rb', line 8 def @related_derivative end |
Class Method Details
.from_hash(hash) ⇒ Object
10 11 12 |
# File 'lib/academic_benchmarks/standards/has_relations.rb', line 10 def self.from_hash(hash) self.new(derivative: hash["derivative"], origin: hash["origin"], related_derivative: hash["related_derivative"]) end |