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



103
104
105
# File 'lib/power-bi/workspace.rb', line 103

def self.get_class
  Workspace
end

Instance Method Details

#create(name) ⇒ Object



107
108
109
110
111
112
113
# File 'lib/power-bi/workspace.rb', line 107

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

#get_dataObject



115
116
117
# File 'lib/power-bi/workspace.rb', line 115

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