Class: LSP::PuppetResourceResponse

Inherits:
LSPBase
  • Object
show all
Defined in:
lib/lsp/lsp_custom.rb

Overview

export interface GetPuppetResourceResponse { data: string; error: string; }

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ PuppetResourceResponse

Returns a new instance of PuppetResourceResponse.



67
68
69
70
# File 'lib/lsp/lsp_custom.rb', line 67

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

Instance Attribute Details

#dataObject

type: string # type: string



65
66
67
# File 'lib/lsp/lsp_custom.rb', line 65

def data
  @data
end

#errorObject

type: string # type: string



65
66
67
# File 'lib/lsp/lsp_custom.rb', line 65

def error
  @error
end

Instance Method Details

#from_h!(value) ⇒ Object



72
73
74
75
76
77
# File 'lib/lsp/lsp_custom.rb', line 72

def from_h!(value)
  value = {} if value.nil?
  self.data = value['data']
  self.error = value['error']
  self
end