Class: Norikra::Client::Target

Inherits:
Thor
  • Object
show all
Includes:
CLIUtil
Defined in:
lib/norikra/client/cli.rb

Instance Method Summary collapse

Methods included from CLIUtil

#client, #formatter, #parser

Instance Method Details

#close(target) ⇒ Object



42
43
44
# File 'lib/norikra/client/cli.rb', line 42

def close(target)
  client(parent_options).close(target)
end

#listObject



19
20
21
22
23
24
25
26
# File 'lib/norikra/client/cli.rb', line 19

def list
  puts "TARGET" unless options[:simple]
  targets = client(parent_options).targets
  targets.each do |t|
    puts t
  end
  puts "#{targets.size} targets found." unless options[:simple]
end

#open(target, *field_defs) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/norikra/client/cli.rb', line 29

def open(target, *field_defs)
  fields = nil
  if field_defs.size > 0
    fields = {}
    field_defs.each do |str|
      fname,ftype = str.split(':')
      fields[fname] = ftype
    end
  end
  client(parent_options).open(target, fields)
end