Class: Cadenya::Types::AgentInfo

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(variation_count: nil, created_by: nil) ⇒ AgentInfo

Returns a new instance of AgentInfo.



417
418
419
420
# File 'lib/cadenya/types.rb', line 417

def initialize(variation_count: nil, created_by: nil)
  @variation_count = variation_count
  @created_by = created_by
end

Instance Attribute Details

#created_byObject (readonly)

Returns the value of attribute created_by.



415
416
417
# File 'lib/cadenya/types.rb', line 415

def created_by
  @created_by
end

#variation_countObject (readonly)

Returns the value of attribute variation_count.



415
416
417
# File 'lib/cadenya/types.rb', line 415

def variation_count
  @variation_count
end

Class Method Details

.from_json(data) ⇒ Object



422
423
424
425
426
427
# File 'lib/cadenya/types.rb', line 422

def self.from_json(data)
  new(
    variation_count: data["variationCount"],
    created_by: data["createdBy"].nil? ? nil : Types::Profile.from_json(data["createdBy"]),
  )
end

Instance Method Details

#to_hObject



429
430
431
432
433
434
# File 'lib/cadenya/types.rb', line 429

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