Class: ScoutApm::Remote::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/scout_apm/remote/message.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, command, *args) ⇒ Message

Returns a new instance of Message.



8
9
10
11
12
# File 'lib/scout_apm/remote/message.rb', line 8

def initialize(type, command, *args)
  @type = type
  @command = command
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



6
7
8
# File 'lib/scout_apm/remote/message.rb', line 6

def args
  @args
end

#commandObject (readonly)

Returns the value of attribute command.



5
6
7
# File 'lib/scout_apm/remote/message.rb', line 5

def command
  @command
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/scout_apm/remote/message.rb', line 4

def type
  @type
end

Class Method Details

.decode(msg) ⇒ Object



14
15
16
# File 'lib/scout_apm/remote/message.rb', line 14

def self.decode(msg)
  Marshal.load(msg)
end

Instance Method Details

#encodeObject



18
19
20
21
22
23
24
# File 'lib/scout_apm/remote/message.rb', line 18

def encode
  Marshal.dump(self)
rescue
  ScoutApm::Agent.instance.logger.info("Failed Marshalling Remote::Message")
  ScoutApm::Agent.instance.logger.info(ScoutApm::Utils::MarshalLogging.new(self).dive) rescue nil
  raise
end