Class: DSP::SourceResponse

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

Overview

interface SourceResponse extends Response {

    body: {
        /** Content of the source reference. */
        content: string;
        /** Optional content type (mime type) of the source. */
        mimeType?: string;
    };
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ SourceResponse

Returns a new instance of SourceResponse.



2620
2621
2622
2623
# File 'lib/dsp/dsp_protocol.rb', line 2620

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

Instance Attribute Details

#bodyObject

type: {



2612
2613
2614
# File 'lib/dsp/dsp_protocol.rb', line 2612

def body
  @body
end

#commandObject

type: {



2612
2613
2614
# File 'lib/dsp/dsp_protocol.rb', line 2612

def command
  @command
end

#messageObject

type: {



2612
2613
2614
# File 'lib/dsp/dsp_protocol.rb', line 2612

def message
  @message
end

#request_seqObject

/** Content of the source reference. */

    content: string;
    /** Optional content type (mime type) of the source. */
    mimeType?: string;
}


2618
2619
2620
# File 'lib/dsp/dsp_protocol.rb', line 2618

def request_seq
  @request_seq
end

#seqObject

type: {



2612
2613
2614
# File 'lib/dsp/dsp_protocol.rb', line 2612

def seq
  @seq
end

#successObject

type: {



2612
2613
2614
# File 'lib/dsp/dsp_protocol.rb', line 2612

def success
  @success
end

#typeObject

type: {



2612
2613
2614
# File 'lib/dsp/dsp_protocol.rb', line 2612

def type
  @type
end

Instance Method Details

#from_h!(value) ⇒ Object



2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
# File 'lib/dsp/dsp_protocol.rb', line 2625

def from_h!(value)
  value = {} if value.nil?
  self.body = value['body'] # Unknown type
  self.request_seq = value['request_seq']
  self.success = value['success'] # Unknown type
  self.command = value['command']
  self.message = value['message']
  self.seq = value['seq']
  self.type = value['type']
  self
end