Class: Ribose::CLI::Commands::Member

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

Instance Method Summary collapse

Instance Method Details

#addObject



19
20
21
22
23
24
# File 'lib/ribose/cli/commands/member.rb', line 19

def add
  add_member_to_space(options)
  say("Invitation 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/member.rb', line 9

def list
  say(build_output(Ribose::Member.all(options[:space_id]), options))
end

#removeObject



42
43
44
45
46
47
# File 'lib/ribose/cli/commands/member.rb', line 42

def remove
  Ribose::Member.delete(options[:space_id], options[:member_id])
  say("The member has been removed from this space")
rescue Ribose::UnprocessableEntity
  say("Something went wrong! Please provide a valid id/uuid")
end

#updateObject



31
32
33
34
35
36
# File 'lib/ribose/cli/commands/member.rb', line 31

def update
  update_member_role(options)
  say("Member has been updated with new role!")
rescue Ribose::UnprocessableEntity
  say("Something went wrong! Please check required attributes")
end