Class: Adalog::MockLoggingAdapter::ReceivedMessage
- Inherits:
-
Struct
- Object
- Struct
- Adalog::MockLoggingAdapter::ReceivedMessage
- 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
-
#args ⇒ Object
Returns the value of attribute args.
-
#block ⇒ Object
Returns the value of attribute block.
-
#kwargs ⇒ Object
Returns the value of attribute kwargs.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#arguments ⇒ Object
A handy list of the received arguments, without the message name.
-
#name ⇒ Object
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.
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
39 40 41 |
# File 'lib/adalog/mock_logging_adapter.rb', line 39 def args @args end |
#block ⇒ Object
Returns the value of attribute block
39 40 41 |
# File 'lib/adalog/mock_logging_adapter.rb', line 39 def block @block end |
#kwargs ⇒ Object
Returns the value of attribute kwargs
39 40 41 |
# File 'lib/adalog/mock_logging_adapter.rb', line 39 def kwargs @kwargs end |
#message ⇒ Object
Returns the value of attribute message
39 40 41 |
# File 'lib/adalog/mock_logging_adapter.rb', line 39 def @message end |
Instance Method Details
#arguments ⇒ Object
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 |
#name ⇒ Object
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 end |