Class: ChemScanner::Interpreter::ReactionStep

Inherits:
Object
  • Object
show all
Defined in:
lib/chem_scanner/interpreter/element/reaction_step.rb

Overview

Reaction Step

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReactionStep

Returns a new instance of ReactionStep.



9
10
11
12
13
14
15
16
# File 'lib/chem_scanner/interpreter/element/reaction_step.rb', line 9

def initialize
  @number = 0
  @description = ""
  @time = ""
  @temperature = ""

  @reagents = []
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



7
8
9
# File 'lib/chem_scanner/interpreter/element/reaction_step.rb', line 7

def description
  @description
end

#numberObject

Returns the value of attribute number.



7
8
9
# File 'lib/chem_scanner/interpreter/element/reaction_step.rb', line 7

def number
  @number
end

#reagentsObject

Returns the value of attribute reagents.



7
8
9
# File 'lib/chem_scanner/interpreter/element/reaction_step.rb', line 7

def reagents
  @reagents
end

#temperatureObject

Returns the value of attribute temperature.



7
8
9
# File 'lib/chem_scanner/interpreter/element/reaction_step.rb', line 7

def temperature
  @temperature
end

#timeObject

Returns the value of attribute time.



7
8
9
# File 'lib/chem_scanner/interpreter/element/reaction_step.rb', line 7

def time
  @time
end

Instance Method Details

#inspectObject



18
19
20
21
22
23
24
25
26
# File 'lib/chem_scanner/interpreter/element/reaction_step.rb', line 18

def inspect
  (
    "#<ReactionStep: description=#{@description}, " +
    "number=#{@number}, " +
    "time=#{@time}, " +
    "temperature=#{@temperature}, " +
    "reagents=#{@reagents}"
  )
end

#to_hashObject



28
29
30
31
32
33
34
35
36
# File 'lib/chem_scanner/interpreter/element/reaction_step.rb', line 28

def to_hash
  {
    number: @number,
    description: @description,
    time: @time,
    temperature: @temperature,
    reagents: @reagents,
  }
end