Class: Cadenya::Types::ModelSpec_Capability_Caching

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(type: nil, caching: nil) ⇒ ModelSpec_Capability_Caching

Returns a new instance of ModelSpec_Capability_Caching.



9509
9510
9511
9512
# File 'lib/cadenya/types.rb', line 9509

def initialize(type: nil, caching: nil)
  @type = type
  @caching = caching
end

Instance Attribute Details

#cachingObject (readonly)

Returns the value of attribute caching.



9507
9508
9509
# File 'lib/cadenya/types.rb', line 9507

def caching
  @caching
end

#typeObject (readonly)

Returns the value of attribute type.



9507
9508
9509
# File 'lib/cadenya/types.rb', line 9507

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



9514
9515
9516
9517
9518
9519
# File 'lib/cadenya/types.rb', line 9514

def self.from_json(data)
  new(
    type: data["type"],
    caching: data["caching"].nil? ? nil : Types::Capability_Caching.from_json(data["caching"]),
  )
end

Instance Method Details

#to_hObject



9521
9522
9523
9524
9525
9526
# File 'lib/cadenya/types.rb', line 9521

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