Class: Cadenya::Types::TenantReference

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, external_id: nil, name: nil) ⇒ TenantReference

Returns a new instance of TenantReference.



5579
5580
5581
5582
5583
# File 'lib/cadenya/types.rb', line 5579

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

Instance Attribute Details

#external_idObject (readonly)

Returns the value of attribute external_id.



5577
5578
5579
# File 'lib/cadenya/types.rb', line 5577

def external_id
  @external_id
end

#idObject (readonly)

Returns the value of attribute id.



5577
5578
5579
# File 'lib/cadenya/types.rb', line 5577

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



5577
5578
5579
# File 'lib/cadenya/types.rb', line 5577

def name
  @name
end

Class Method Details

.from_json(data) ⇒ Object



5585
5586
5587
5588
5589
5590
5591
# File 'lib/cadenya/types.rb', line 5585

def self.from_json(data)
  new(
    id: data["id"],
    external_id: data["externalId"],
    name: data["name"],
  )
end

Instance Method Details

#to_hObject



5593
5594
5595
5596
5597
5598
5599
# File 'lib/cadenya/types.rb', line 5593

def to_h
  {
    id: Util.plain(@id),
    external_id: Util.plain(@external_id),
    name: Util.plain(@name),
  }.reject { |_k, v| v.nil? }
end