Class: DSP::ValueFormat

Inherits:
DSPBase show all
Defined in:
lib/dsp/dsp_protocol.rb

Overview

interface ValueFormat {

    /** Display the value in hex. */
    hex?: boolean;
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ ValueFormat

Returns a new instance of ValueFormat.



4438
4439
4440
4441
# File 'lib/dsp/dsp_protocol.rb', line 4438

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[hex]
end

Instance Attribute Details

#hexObject

type: boolean



4436
4437
4438
# File 'lib/dsp/dsp_protocol.rb', line 4436

def hex
  @hex
end

Instance Method Details

#from_h!(value) ⇒ Object



4443
4444
4445
4446
4447
# File 'lib/dsp/dsp_protocol.rb', line 4443

def from_h!(value)
  value = {} if value.nil?
  self.hex = value['hex'] # Unknown type
  self
end