Class: PowerBI::WorkspaceArray

Inherits:
Array
  • Object
show all
Defined in:
lib/power-bi/workspace.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Array

#initialize, #reload

Constructor Details

This class inherits a constructor from PowerBI::Array

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PowerBI::Array

Class Method Details

.get_classObject



60
61
62
# File 'lib/power-bi/workspace.rb', line 60

def self.get_class
  Workspace
end

Instance Method Details

#create(name) ⇒ Object



64
65
66
67
68
69
70
# File 'lib/power-bi/workspace.rb', line 64

def create(name)
  data = @tenant.post("/groups", {workspaceV2: 'True'}) do |req|
    req.body = {name: name}.to_json
  end
  self.reload
  Workspace.new(@tenant, data)
end

#get_dataObject



72
73
74
# File 'lib/power-bi/workspace.rb', line 72

def get_data
  @tenant.get("/groups")[:value]
end