Class: Bl::Wiki

Inherits:
Thor
  • Object
show all
Includes:
Requestable
Defined in:
lib/bl/wiki.rb

Instance Method Summary collapse

Methods included from Requestable

client

Constructor Details

#initializeWiki



5
6
7
8
9
# File 'lib/bl/wiki.rb', line 5

def initialize(*)
  @config = Bl::Config.instance
  @url = 'wikis'
  super
end

Instance Method Details

#listObject



12
13
14
15
16
# File 'lib/bl/wiki.rb', line 12

def list
  client.get(@url, projectIdOrKey: @config[:project_key]).body.each do |w|
    puts [w.id, w.projectId, w.name, w.updated].join("\t")
  end
end

#show(id) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/bl/wiki.rb', line 19

def show(id)
  body = client.get("#{@url}/#{id}").body
  puts "id: #{body.id}"
  puts "projectId: #{body.projectId}"
  puts "name: #{body.name}"
  puts "updated: #{body.updated}"
  puts '--'
  puts 'content:'
  puts body.content
end