Class: PuppetEditorServices::Protocol::JsonRPCMessages::NotificationMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/puppet_editor_services/protocol/json_rpc_messages.rb

Overview

/**

  * The notification's params.
  */
params?: Array<any> | object;

}

Instance Attribute Summary collapse

Attributes inherited from Message

#jsonrpc

Instance Method Summary collapse

Methods inherited from Message

#to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ NotificationMessage

Returns a new instance of NotificationMessage.



91
92
93
# File 'lib/puppet_editor_services/protocol/json_rpc_messages.rb', line 91

def initialize(initial_hash = nil)
  super
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



89
90
91
# File 'lib/puppet_editor_services/protocol/json_rpc_messages.rb', line 89

def params
  @params
end

#rpc_methodObject

Returns the value of attribute rpc_method.



89
90
91
# File 'lib/puppet_editor_services/protocol/json_rpc_messages.rb', line 89

def rpc_method
  @rpc_method
end

Instance Method Details

#from_h!(value) ⇒ Object



95
96
97
98
99
100
101
# File 'lib/puppet_editor_services/protocol/json_rpc_messages.rb', line 95

def from_h!(value)
  value = {} if value.nil?
  super
  self.rpc_method = value['method']
  self.params = value['params']
  self
end

#to_hObject



103
104
105
106
107
# File 'lib/puppet_editor_services/protocol/json_rpc_messages.rb', line 103

def to_h
  hash = { 'method' => rpc_method }
  hash['params'] = params unless params.nil?
  super.merge(hash)
end