Class: PowerBI::User
Instance Attribute Summary collapse
- 
  
    
      #workspace  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute workspace. 
Attributes inherited from Object
Instance Method Summary collapse
- #data_to_attributes(data) ⇒ Object
- #delete ⇒ Object
- 
  
    
      #initialize(tenant, parent, id = nil)  ⇒ User 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of User. 
Methods inherited from Object
instantiate_from_data, #reload, #set_attributes
Constructor Details
#initialize(tenant, parent, id = nil) ⇒ User
Returns a new instance of User.
| 5 6 7 8 | # File 'lib/power-bi/user.rb', line 5 def initialize(tenant, parent, id = nil) super(tenant, id) @workspace = parent end | 
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PowerBI::Object
Instance Attribute Details
#workspace ⇒ Object (readonly)
Returns the value of attribute workspace.
| 3 4 5 | # File 'lib/power-bi/user.rb', line 3 def workspace @workspace end | 
Instance Method Details
#data_to_attributes(data) ⇒ Object
| 10 11 12 13 14 15 16 17 18 | # File 'lib/power-bi/user.rb', line 10 def data_to_attributes(data) { email_address: data[:emailAddress], group_user_access_right: data[:groupUserAccessRight], display_name: data[:displayName], identifier: data[:identifier], principal_type: data[:principalType], } end | 
#delete ⇒ Object
| 20 21 22 23 | # File 'lib/power-bi/user.rb', line 20 def delete @tenant.delete("/groups/#{@workspace.id}/users/#{email_address}") @workspace.users.reload end |