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



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

def self.get_class
  Workspace
end

Instance Method Details

#create(name) ⇒ Object



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

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



79
80
81
# File 'lib/power-bi/workspace.rb', line 79

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