Class: SDM::GroupFromRole

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(accounts: nil, approval_flows: nil, group: nil, rate_limit: nil, role: nil) ⇒ GroupFromRole

Returns a new instance of GroupFromRole.



8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
# File 'lib/models/porcelain.rb', line 8205

def initialize(
  accounts: nil,
  approval_flows: nil,
  group: nil,
  rate_limit: nil,
  role: nil
)
  @accounts = accounts == nil ? [] : accounts
  @approval_flows = approval_flows == nil ? [] : approval_flows
  @group = group == nil ? nil : group
  @rate_limit = rate_limit == nil ? nil : rate_limit
  @role = role == nil ? nil : role
end

Instance Attribute Details

#accountsObject

The migrated Accounts.



8195
8196
8197
# File 'lib/models/porcelain.rb', line 8195

def accounts
  @accounts
end

#approval_flowsObject

The affected approval flows.



8197
8198
8199
# File 'lib/models/porcelain.rb', line 8197

def approval_flows
  @approval_flows
end

#groupObject

The group created from the source role.



8199
8200
8201
# File 'lib/models/porcelain.rb', line 8199

def group
  @group
end

#rate_limitObject

Rate limit information.



8201
8202
8203
# File 'lib/models/porcelain.rb', line 8201

def rate_limit
  @rate_limit
end

#roleObject

The source role.



8203
8204
8205
# File 'lib/models/porcelain.rb', line 8203

def role
  @role
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8219
8220
8221
8222
8223
8224
8225
# File 'lib/models/porcelain.rb', line 8219

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