Class: SDM::PeeringGroup

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

Overview

PeeringGroups are the building blocks used for explicit network topology making. They may be linked to other peering groups. Sets of PeeringGroupResource and PeeringGroupNode can be attached to a peering group.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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



6524
6525
6526
6527
6528
6529
6530
# File 'lib/models/porcelain.rb', line 6524

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

Instance Attribute Details

#idObject

Unique identifier of the PeeringGroup.



6520
6521
6522
# File 'lib/models/porcelain.rb', line 6520

def id
  @id
end

#nameObject

Unique human-readable name of the PeeringGroup.



6522
6523
6524
# File 'lib/models/porcelain.rb', line 6522

def name
  @name
end

Instance Method Details

#to_json(options = {}) ⇒ Object



6532
6533
6534
6535
6536
6537
6538
# File 'lib/models/porcelain.rb', line 6532

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