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.



10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
# File 'lib/models/porcelain.rb', line 10139

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_idObject

The account for this remote identity.



10131
10132
10133
# File 'lib/models/porcelain.rb', line 10131

def 
  @account_id
end

#idObject

Unique identifier of the RemoteIdentity.



10133
10134
10135
# File 'lib/models/porcelain.rb', line 10133

def id
  @id
end

#remote_identity_group_idObject

The remote identity group.



10135
10136
10137
# File 'lib/models/porcelain.rb', line 10135

def remote_identity_group_id
  @remote_identity_group_id
end

#usernameObject

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



10137
10138
10139
# File 'lib/models/porcelain.rb', line 10137

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



10151
10152
10153
10154
10155
10156
10157
# File 'lib/models/porcelain.rb', line 10151

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