Class: SDM::IdentitySet

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

Overview

A IdentitySet defines a group of identity aliases.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, name: nil) ⇒ IdentitySet

Returns a new instance of IdentitySet.



5659
5660
5661
5662
5663
5664
5665
# File 'lib/models/porcelain.rb', line 5659

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

Instance Attribute Details

#idObject

Unique identifier of the IdentitySet.



5655
5656
5657
# File 'lib/models/porcelain.rb', line 5655

def id
  @id
end

#nameObject

Unique human-readable name of the IdentitySet.



5657
5658
5659
# File 'lib/models/porcelain.rb', line 5657

def name
  @name
end

Instance Method Details

#to_json(options = {}) ⇒ Object



5667
5668
5669
5670
5671
5672
5673
# File 'lib/models/porcelain.rb', line 5667

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