Class: ResolveInstanceHandler
Instance Method Summary
collapse
#handle_command, #iterate
Constructor Details
Returns a new instance of ResolveInstanceHandler.
9
10
11
|
# File 'lib/hypertube-ruby-sdk/core/handler/resolve_instance_handler.rb', line 9
def initialize
@required_parameters_count = 1
end
|
Instance Method Details
#process(command) ⇒ Object
13
14
15
|
# File 'lib/hypertube-ruby-sdk/core/handler/resolve_instance_handler.rb', line 13
def process(command)
resolve_reference(command)
end
|
#resolve_reference(command) ⇒ Object
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/hypertube-ruby-sdk/core/handler/resolve_instance_handler.rb', line 17
def resolve_reference(command)
if command.payload.length != @required_parameters_count
raise ArgumentError.new 'Resolve Instance parameters mismatch'
end
if command.runtime_name == RuntimeNameHt::RUBY
return ReferencesCache.instance.resolve_reference(command.payload[0])
end
Command.new(command.runtime_name, CommandType::REFERENCE, command.payload[0])
end
|