Class: Ribose::CLI::Commands::Space

Inherits:
Base
  • Object
show all
Defined in:
lib/ribose/cli/commands/space.rb

Instance Method Summary collapse

Instance Method Details

#addObject



27
28
29
30
# File 'lib/ribose/cli/commands/space.rb', line 27

def add
  space = Ribose::Space.create(**symbolize_keys(options))
  say("New Space created! Id: " + space.id)
end

#listObject



8
9
10
# File 'lib/ribose/cli/commands/space.rb', line 8

def list
  say(build_output(list_user_spaces, options))
end

#removeObject



51
52
53
54
55
56
# File 'lib/ribose/cli/commands/space.rb', line 51

def remove
  remove_space(options)
  say("The Sapce has been removed!")
rescue
  say("Please provide a valid Space UUID")
end

#showObject



16
17
18
19
# File 'lib/ribose/cli/commands/space.rb', line 16

def show
  space = Ribose::Space.fetch(options[:space_id])
  say(build_resource_output(space, options))
end

#updateObject



39
40
41
42
43
44
45
# File 'lib/ribose/cli/commands/space.rb', line 39

def update
  attributes = symbolize_keys(options)
  Ribose::Space.update(attributes.delete(:space_id), attributes)
  say("Your space has been updated!")
rescue Ribose::UnprocessableEntity
  say("Something went wrong!, please check required attributes")
end