Module: WinRM::PSRP::MessageData

Defined in:
lib/winrm/psrp/message_data.rb,
lib/winrm/psrp/message_data/base.rb,
lib/winrm/psrp/message_data/error_record.rb,
lib/winrm/psrp/message_data/pipeline_state.rb,
lib/winrm/psrp/message_data/pipeline_output.rb,
lib/winrm/psrp/message_data/pipeline_host_call.rb,
lib/winrm/psrp/message_data/runspacepool_state.rb,
lib/winrm/psrp/message_data/session_capability.rb,
lib/winrm/psrp/message_data/runspacepool_host_call.rb

Overview

PowerShell Remoting Protocol message data.

Defined Under Namespace

Classes: Base, ErrorRecord, PipelineHostCall, PipelineOutput, PipelineState, RunspacepoolHostCall, RunspacepoolState, SessionCapability

Class Method Summary collapse

Class Method Details

.camelize(underscore) ⇒ Object



35
36
37
# File 'lib/winrm/psrp/message_data.rb', line 35

def self.camelize(underscore)
  underscore.split('_').collect(&:capitalize).join
end

.parse(message) ⇒ Object



29
30
31
32
33
# File 'lib/winrm/psrp/message_data.rb', line 29

def self.parse(message)
  type_key = WinRM::PSRP::Message::MESSAGE_TYPES.key(message.type)
  type = camelize(type_key.to_s).to_sym
  const_get(type).new(message.data) if MessageData.constants.include?(type)
end