Class: Sample::EchoTest

Inherits:
Object
  • Object
show all
Defined in:
lib/registry/echo_test.rb

Class Method Summary collapse

Class Method Details

.availableObject



9
10
11
# File 'lib/registry/echo_test.rb', line 9

def self.available
  { "echo-test" => [] }
end

.handle(app, cmd, display_messages) ⇒ Object



13
14
15
16
17
18
# File 'lib/registry/echo_test.rb', line 13

def self.handle(app,cmd,display_messages)
  result = app.default_result
  result[:data] = cmd["echo-test".size..-1].strip
  app.console.print("ECHO: #{result[:data]}") if display_messages
  result
end

.handle?(cmd) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/registry/echo_test.rb', line 5

def self.handle?(cmd)
  cmd.start_with?("echo-test")
end