Class: Cadenya::Types::SubjectInfo

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(tenant: nil, objective_count: nil) ⇒ SubjectInfo

Returns a new instance of SubjectInfo.



5325
5326
5327
5328
# File 'lib/cadenya/types.rb', line 5325

def initialize(tenant: nil, objective_count: nil)
  @tenant = tenant
  @objective_count = objective_count
end

Instance Attribute Details

#objective_countObject (readonly)

Returns the value of attribute objective_count.



5323
5324
5325
# File 'lib/cadenya/types.rb', line 5323

def objective_count
  @objective_count
end

#tenantObject (readonly)

Returns the value of attribute tenant.



5323
5324
5325
# File 'lib/cadenya/types.rb', line 5323

def tenant
  @tenant
end

Class Method Details

.from_json(data) ⇒ Object



5330
5331
5332
5333
5334
5335
# File 'lib/cadenya/types.rb', line 5330

def self.from_json(data)
  new(
    tenant: data["tenant"].nil? ? nil : Types::TenantReference.from_json(data["tenant"]),
    objective_count: data["objectiveCount"],
  )
end

Instance Method Details

#to_hObject



5337
5338
5339
5340
5341
5342
# File 'lib/cadenya/types.rb', line 5337

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