Class: DSP::SourceArguments

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

Overview

interface SourceArguments {

    /** Specifies the source content to load. Either source.path or source.sourceReference must be specified. */
    source?: Source;
    /** The reference to the source. This is the same as source.sourceReference.
        This is provided for backward compatibility since old backends do not understand the 'source' attribute.
    */
    sourceReference: number;
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ SourceArguments

Returns a new instance of SourceArguments.



2590
2591
2592
2593
# File 'lib/dsp/dsp_protocol.rb', line 2590

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

Instance Attribute Details

#sourceObject

type: Source # type: number



2588
2589
2590
# File 'lib/dsp/dsp_protocol.rb', line 2588

def source
  @source
end

#sourceReferenceObject

type: Source # type: number



2588
2589
2590
# File 'lib/dsp/dsp_protocol.rb', line 2588

def sourceReference
  @sourceReference
end

Instance Method Details

#from_h!(value) ⇒ Object



2595
2596
2597
2598
2599
2600
# File 'lib/dsp/dsp_protocol.rb', line 2595

def from_h!(value)
  value = {} if value.nil?
  self.source = Source.new(value['source']) unless value['source'].nil?
  self.sourceReference = value['sourceReference']
  self
end