Top Level Namespace

Defined Under Namespace

Classes: Iuid

Instance Method Summary collapse

Instance Method Details

#create(options) ⇒ Object



27
28
29
30
31
32
33
# File 'bin/iuid', line 27

def create(options)
  miss('category') unless options[:category]
  Iuid.new(options.delete(:config_file)).create(
    options.delete(:name),
    options.delete(:category)
  )
end

#delete(options) ⇒ Object



48
49
50
51
52
# File 'bin/iuid', line 48

def delete(options)
  Iuid.new(options.delete(:config_file)).delete(
    options.delete(:name)
  )
end

#get(options) ⇒ Object



35
36
37
38
39
# File 'bin/iuid', line 35

def get(options)
  Iuid.new(options.delete(:config_file)).get(
    options.delete(:name)
  )
end

#miss(what) ⇒ Object



54
55
56
57
# File 'bin/iuid', line 54

def miss(what)
  STDERR.puts "Missing #{what}, exiting..."
  exit 1
end

#set(options) ⇒ Object



40
41
42
43
44
45
46
# File 'bin/iuid', line 40

def set(options)
  miss('uid') unless options[:category]  # this is actually the uid
  Iuid.new(options.delete(:config_file)).set(
    options.delete(:name),
    options.delete(:category)
  )
end