Class: Liebre::Actor::Context
- Inherits:
-
Object
- Object
- Liebre::Actor::Context
- Defined in:
- lib/liebre/actor/context.rb,
lib/liebre/actor/context/declare.rb,
lib/liebre/actor/context/handler.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#chan ⇒ Object
readonly
Returns the value of attribute chan.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
- #declare ⇒ Object
- #handler ⇒ Object
-
#initialize(chan, name, opts, config) ⇒ Context
constructor
A new instance of Context.
- #logger ⇒ Object
- #spec ⇒ Object
Constructor Details
#initialize(chan, name, opts, config) ⇒ Context
Returns a new instance of Context.
10 11 12 13 14 15 16 |
# File 'lib/liebre/actor/context.rb', line 10 def initialize chan, name, opts, config @chan = chan @name = name @opts = opts @config = config end |
Instance Attribute Details
#chan ⇒ Object (readonly)
Returns the value of attribute chan.
8 9 10 |
# File 'lib/liebre/actor/context.rb', line 8 def chan @chan end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/liebre/actor/context.rb', line 8 def name @name end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
8 9 10 |
# File 'lib/liebre/actor/context.rb', line 8 def opts @opts end |
Instance Method Details
#declare ⇒ Object
22 23 24 |
# File 'lib/liebre/actor/context.rb', line 22 def declare @declare ||= Declare.new(chan) end |
#handler ⇒ Object
26 27 28 |
# File 'lib/liebre/actor/context.rb', line 26 def handler @handler ||= Handler.new(opts) end |
#logger ⇒ Object
30 31 32 |
# File 'lib/liebre/actor/context.rb', line 30 def logger config.logger end |
#spec ⇒ Object
18 19 20 |
# File 'lib/liebre/actor/context.rb', line 18 def spec opts.fetch(:resources, {}) end |