Class: LSP::PuppetFactResponse

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

Overview

export interface GetPuppetFactResponse { 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) ⇒ PuppetFactResponse

Returns a new instance of PuppetFactResponse.



47
48
49
50
# File 'lib/lsp/lsp_custom.rb', line 47

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

Instance Attribute Details

#errorObject

type: string # type: string



45
46
47
# File 'lib/lsp/lsp_custom.rb', line 45

def error
  @error
end

#factsObject

type: string # type: string



45
46
47
# File 'lib/lsp/lsp_custom.rb', line 45

def facts
  @facts
end

Instance Method Details

#from_h!(value) ⇒ Object



52
53
54
55
56
57
# File 'lib/lsp/lsp_custom.rb', line 52

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