Class: SDM::RemoteIdentity

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

RemoteIdentities define the username to be used for a specific account when connecting to a remote resource using that group.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id: nil, id: nil, remote_identity_group_id: nil, username: nil) ⇒ RemoteIdentity

Returns a new instance of RemoteIdentity.



15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
# File 'lib/models/porcelain.rb', line 15652

def initialize(
  account_id: nil,
  id: nil,
  remote_identity_group_id: nil,
  username: nil
)
  @account_id =  == nil ? "" : 
  @id = id == nil ? "" : id
  @remote_identity_group_id = remote_identity_group_id == nil ? "" : remote_identity_group_id
  @username = username == nil ? "" : username
end

Instance Attribute Details

#account_id ⇒ Object

The account for this remote identity.



15644
15645
15646
# File 'lib/models/porcelain.rb', line 15644

def 
  @account_id
end

#id ⇒ Object

Unique identifier of the RemoteIdentity.



15646
15647
15648
# File 'lib/models/porcelain.rb', line 15646

def id
  @id
end

#remote_identity_group_id ⇒ Object

The remote identity group.



15648
15649
15650
# File 'lib/models/porcelain.rb', line 15648

def remote_identity_group_id
  @remote_identity_group_id
end

#username ⇒ Object

The username to be used as the remote identity for this account.



15650
15651
15652
# File 'lib/models/porcelain.rb', line 15650

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



15664
15665
15666
15667
15668
15669
15670
# File 'lib/models/porcelain.rb', line 15664

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end