Class: Cadenya::Types::SubjectAssertion

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, name: nil) ⇒ SubjectAssertion

Returns a new instance of SubjectAssertion.



5302
5303
5304
5305
# File 'lib/cadenya/types.rb', line 5302

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



5300
5301
5302
# File 'lib/cadenya/types.rb', line 5300

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



5300
5301
5302
# File 'lib/cadenya/types.rb', line 5300

def name
  @name
end

Class Method Details

.from_json(data) ⇒ Object



5307
5308
5309
5310
5311
5312
# File 'lib/cadenya/types.rb', line 5307

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

Instance Method Details

#to_hObject



5314
5315
5316
5317
5318
5319
# File 'lib/cadenya/types.rb', line 5314

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