Class: Ribose::CLI::Commands::JoinSpace

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

Instance Method Summary collapse

Instance Method Details

#acceptObject



38
39
40
41
# File 'lib/ribose/cli/commands/join_space.rb', line 38

def accept
  Ribose::JoinSpaceRequest.accept(options[:request_id])
  say("Join space request has been accepted!")
end

#addObject



28
29
30
31
32
33
# File 'lib/ribose/cli/commands/join_space.rb', line 28

def add
  create_join_request(options)
  say("Join space request has been sent successfully!")
rescue Ribose::UnprocessableEntity
  say("Something went wrong! Please check required attributes")
end

#listObject



9
10
11
# File 'lib/ribose/cli/commands/join_space.rb', line 9

def list
  say(build_output(Ribose::JoinSpaceRequest.all(options), options))
end

#rejectObject



46
47
48
49
# File 'lib/ribose/cli/commands/join_space.rb', line 46

def reject
  Ribose::JoinSpaceRequest.reject(options[:request_id])
  say("Join space request has been rejected!")
end

#showObject



17
18
19
20
# File 'lib/ribose/cli/commands/join_space.rb', line 17

def show
  join_space = Ribose::JoinSpaceRequest.fetch(options[:request_id])
  say(build_resource_output(join_space, options))
end