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.



9600
9601
9602
9603
9604
9605
9606
# File 'lib/models/porcelain.rb', line 9600

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

Instance Attribute Details

#id ⇒ Object

Unique identifier of the IdentitySet.



9596
9597
9598
# File 'lib/models/porcelain.rb', line 9596

def id
  @id
end

#name ⇒ Object

Unique human-readable name of the IdentitySet.



9598
9599
9600
# File 'lib/models/porcelain.rb', line 9598

def name
  @name
end

Instance Method Details

#to_json(options = {}) ⇒ Object



9608
9609
9610
9611
9612
9613
9614
# File 'lib/models/porcelain.rb', line 9608

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