Class: Elastomer::CLI::Application

Inherits:
Base
  • Object
show all
Defined in:
lib/elastomer/cli/application.rb

Instance Method Summary collapse

Instance Method Details

#cat(command = nil, scope = nil) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/elastomer/cli/application.rb', line 24

def cat(command=nil, scope=nil)
  params = {:v => true}
  if command == 'help'
    command = nil
    if !scope.empty?
      command = scope
      params[:help] = true
    end
  end
  template = Addressable::Template.new("/_cat{/command}{/scope}")
  path = template.expand(:command => command, :scope => scope)
  response = client.request(:get, path, params).body
  puts response
end