Class: OpenTrons::Commands

Inherits:
Object
  • Object
show all
Defined in:
lib/opentrons/commands.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(protocol) ⇒ Commands



5
6
7
8
# File 'lib/opentrons/commands.rb', line 5

def initialize(protocol)
  @protocol = protocol
  @command_list = []
end

Instance Attribute Details

#command_listObject

Returns the value of attribute command_list.



3
4
5
# File 'lib/opentrons/commands.rb', line 3

def command_list
  @command_list
end

#protocolObject

Returns the value of attribute protocol.



3
4
5
# File 'lib/opentrons/commands.rb', line 3

def protocol
  @protocol
end

Instance Method Details

#inspectObject



19
20
21
# File 'lib/opentrons/commands.rb', line 19

def inspect
  to_s
end

#to_listObject

return a pure list of hashes



11
12
13
# File 'lib/opentrons/commands.rb', line 11

def to_list
  return command_list.map {|command| command.to_hash}
end

#to_sObject



15
16
17
# File 'lib/opentrons/commands.rb', line 15

def to_s
  "<OpenTrons::Commands:0x#{self.__id__.to_s(16)}>"
end