Class: DSP::ExceptionPathSegment

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

Overview

interface ExceptionPathSegment {

    /** If false or missing this segment matches the names provided, otherwise it matches anything except the names provided. */
    negate?: boolean;
    /** Depending on the value of 'negate' the names that should match or not match. */
    names: string[];
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ ExceptionPathSegment

Returns a new instance of ExceptionPathSegment.



4521
4522
4523
4524
# File 'lib/dsp/dsp_protocol.rb', line 4521

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

Instance Attribute Details

#namesObject

type: boolean # type: string[]



4519
4520
4521
# File 'lib/dsp/dsp_protocol.rb', line 4519

def names
  @names
end

#negateObject

type: boolean # type: string[]



4519
4520
4521
# File 'lib/dsp/dsp_protocol.rb', line 4519

def negate
  @negate
end

Instance Method Details

#from_h!(value) ⇒ Object



4526
4527
4528
4529
4530
4531
# File 'lib/dsp/dsp_protocol.rb', line 4526

def from_h!(value)
  value = {} if value.nil?
  self.negate = value['negate'] # Unknown type
  self.names = value['names'].map { |val| val } unless value['names'].nil?
  self
end