Class: Cadenya::Types::ModelSpec_Capability_Temperature

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, temperature: nil) ⇒ ModelSpec_Capability_Temperature

Returns a new instance of ModelSpec_Capability_Temperature.



9371
9372
9373
9374
# File 'lib/cadenya/types.rb', line 9371

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

Instance Attribute Details

#temperatureObject (readonly)

Returns the value of attribute temperature.



9369
9370
9371
# File 'lib/cadenya/types.rb', line 9369

def temperature
  @temperature
end

#typeObject (readonly)

Returns the value of attribute type.



9369
9370
9371
# File 'lib/cadenya/types.rb', line 9369

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



9376
9377
9378
9379
9380
9381
# File 'lib/cadenya/types.rb', line 9376

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

Instance Method Details

#to_hObject



9383
9384
9385
9386
9387
9388
# File 'lib/cadenya/types.rb', line 9383

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