Class: Liebre::Actor::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/liebre/actor/context.rb,
lib/liebre/actor/context/declare.rb,
lib/liebre/actor/context/handler.rb

Defined Under Namespace

Classes: Declare, Handler

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#chanObject (readonly)

Returns the value of attribute chan.



8
9
10
# File 'lib/liebre/actor/context.rb', line 8

def chan
  @chan
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/liebre/actor/context.rb', line 8

def name
  @name
end

#optsObject (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

#declareObject



22
23
24
# File 'lib/liebre/actor/context.rb', line 22

def declare
  @declare ||= Declare.new(chan)
end

#handlerObject



26
27
28
# File 'lib/liebre/actor/context.rb', line 26

def handler
  @handler ||= Handler.new(opts)
end

#loggerObject



30
31
32
# File 'lib/liebre/actor/context.rb', line 30

def logger
  config.logger
end

#specObject



18
19
20
# File 'lib/liebre/actor/context.rb', line 18

def spec
  opts.fetch(:resources, {})
end