Class: OpenTrons::Command

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

Direct Known Subclasses

Delay, PipetteCommand

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, params) ⇒ Command

parent class for all the comands



28
29
30
31
# File 'lib/opentrons/commands.rb', line 28

def initialize(command, params)
	@command = command
	@params = params
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



25
26
27
# File 'lib/opentrons/commands.rb', line 25

def command
  @command
end

#paramsObject

Returns the value of attribute params.



25
26
27
# File 'lib/opentrons/commands.rb', line 25

def params
  @params
end

Instance Method Details

#inspectObject



44
45
46
# File 'lib/opentrons/commands.rb', line 44

def inspect
	to_s
end

#to_hashObject



33
34
35
36
37
38
# File 'lib/opentrons/commands.rb', line 33

def to_hash
	as_hash = {}
	as_hash["command"] = command
	as_hash["params"] = params
	return as_hash
end

#to_sObject



40
41
42
# File 'lib/opentrons/commands.rb', line 40

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