Class: Ribose::CLI::Commands::Note

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

Instance Method Summary collapse

Instance Method Details

#addObject



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

def add
  note = create_note(options)
  say("Note has been posted added! Id: " + note.id.to_s)
end

#listObject



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

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

#removeObject



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

def remove
  remove_note(options)
  say("The note has been removed!")
rescue
  say("Could not remove the specified note")
end

#showObject



18
19
20
21
# File 'lib/ribose/cli/commands/note.rb', line 18

def show
  note = Ribose::Wiki.fetch(options[:space_id], options[:note_id])
  say(build_resource_output(note, options))
end

#updateObject



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

def update
  update_note(options)
  say("Your space note has been updated!")
rescue Ribose::UnprocessableEntity
  say("Something went wrong!, please check required attributes")
end