Class: Mural::Client::Workspaces

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/mural/client/workspaces.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Workspaces



10
11
12
# File 'lib/mural/client/workspaces.rb', line 10

def initialize(client)
  @client = client
end

Instance Method Details

#list(next_page: nil) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/mural/client/workspaces.rb', line 15

def list(next_page: nil)
  json = get('/api/public/v1/workspaces', { next: next_page })

  workspaces = json['value'].map do |json_wp|
    ::Mural::Workspace.decode(json_wp)
  end

  [workspaces, json['next']]
end

#retrieve(workspace_id) ⇒ Object



26
27
28
29
30
# File 'lib/mural/client/workspaces.rb', line 26

def retrieve(workspace_id)
  json = get("/api/public/v1/workspaces/#{workspace_id}")

  ::Mural::Workspace.decode(json['value'])
end