Class: Adalog::MockLoggingAdapter::ReceivedMessage

Inherits:
Struct
  • Object
show all
Defined in:
lib/adalog/mock_logging_adapter.rb

Overview

A class to encapsulate the data logged for received messages and all of their arguments.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



39
40
41
# File 'lib/adalog/mock_logging_adapter.rb', line 39

def args
  @args
end

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



39
40
41
# File 'lib/adalog/mock_logging_adapter.rb', line 39

def block
  @block
end

#kwargsObject

Returns the value of attribute kwargs

Returns:

  • (Object)

    the current value of kwargs



39
40
41
# File 'lib/adalog/mock_logging_adapter.rb', line 39

def kwargs
  @kwargs
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



39
40
41
# File 'lib/adalog/mock_logging_adapter.rb', line 39

def message
  @message
end

Instance Method Details

#argumentsObject

A handy list of the received arguments, without the message name.



52
53
54
55
56
57
# File 'lib/adalog/mock_logging_adapter.rb', line 52

def arguments
  result  = []
  result += args
  result << kwargs unless kwargs.empty?
  result
end

#nameObject

Just a little alias in case you’re not as used to, or comfortable with, referring to Ruby method calls as ‘messages’ that are sent and received. But should be. Because that’s what they are.



46
47
48
# File 'lib/adalog/mock_logging_adapter.rb', line 46

def name
  message
end