Class: PowerBI::UserArray
Class Method Summary collapse
Instance Method Summary collapse
- #create(email_address, access_right: "Viewer") ⇒ Object
- #get_data ⇒ Object
-
#initialize(tenant, workspace) ⇒ UserArray
constructor
A new instance of UserArray.
Methods inherited from Array
Constructor Details
#initialize(tenant, workspace) ⇒ UserArray
Returns a new instance of UserArray.
29 30 31 32 |
# File 'lib/power-bi/user.rb', line 29 def initialize(tenant, workspace) super(tenant, workspace) @workspace = workspace end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PowerBI::Array
Class Method Details
Instance Method Details
#create(email_address, access_right: "Viewer") ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/power-bi/user.rb', line 38 def create(email_address, access_right: "Viewer") @tenant.post("/groups/#{@workspace.id}/users") do |req| req.body = { emailAddress: email_address, groupUserAccessRight: access_right }.to_json end self.reload end |
#get_data ⇒ Object
48 49 50 |
# File 'lib/power-bi/user.rb', line 48 def get_data @tenant.get("/groups/#{@workspace.id}/users")[:value] end |