Class: Moleculer::Context
- Inherits:
-
Object
- Object
- Moleculer::Context
- Defined in:
- lib/moleculer/context.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(broker:, action:, params:, meta:, parent_id: nil, level: 1, timeout:, id: nil) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(broker:, action:, params:, meta:, parent_id: nil, level: 1, timeout:, id: nil) ⇒ Context
Returns a new instance of Context.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/moleculer/context.rb', line 11 def initialize(broker:, action:, params:, meta:, parent_id: nil, level: 1, timeout:, id: nil) @id = id ? id : SecureRandom.uuid @broker = broker @action = action @request_id = SecureRandom.uuid @parent_id = parent_id @params = params @meta = @level = level @timeout = timeout end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/moleculer/context.rb', line 3 def action @action end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/moleculer/context.rb', line 3 def id @id end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
3 4 5 |
# File 'lib/moleculer/context.rb', line 3 def level @level end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
3 4 5 |
# File 'lib/moleculer/context.rb', line 3 def @meta end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/moleculer/context.rb', line 3 def params @params end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
3 4 5 |
# File 'lib/moleculer/context.rb', line 3 def request_id @request_id end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
3 4 5 |
# File 'lib/moleculer/context.rb', line 3 def timeout @timeout end |