Class: SDM::AccountGroup

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

Overview

An AccountGroup is a link between an Account and a Group.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id: nil, group_id: nil, id: nil) ⇒ AccountGroup

Returns a new instance of AccountGroup.



1888
1889
1890
1891
1892
1893
1894
1895
1896
# File 'lib/models/porcelain.rb', line 1888

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

Instance Attribute Details

#account_id ⇒ Object

Unique identifier of the Account.



1882
1883
1884
# File 'lib/models/porcelain.rb', line 1882

def 
  @account_id
end

#group_id ⇒ Object

Unique identifier of the Group.



1884
1885
1886
# File 'lib/models/porcelain.rb', line 1884

def group_id
  @group_id
end

#id ⇒ Object

Unique identifier of the AccountGroup.



1886
1887
1888
# File 'lib/models/porcelain.rb', line 1886

def id
  @id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1898
1899
1900
1901
1902
1903
1904
# File 'lib/models/porcelain.rb', line 1898

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