Class: Celluloid::Application::Supervisable
- Defined in:
- lib/vendor/celluloid/lib/celluloid/application.rb
Overview
A subcomponent of an application to be supervised
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#as ⇒ Object
readonly
Returns the value of attribute as.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
-
#initialize(klass, options = {}) ⇒ Supervisable
constructor
A new instance of Supervisable.
- #supervise ⇒ Object
Constructor Details
#initialize(klass, options = {}) ⇒ Supervisable
Returns a new instance of Supervisable.
63 64 65 66 67 68 69 70 71 |
# File 'lib/vendor/celluloid/lib/celluloid/application.rb', line 63 def initialize(klass, = {}) @klass = klass # Stringify keys :/ = .inject({}) { |h,(k,v)| h[k.to_s] = v; h } @as = ['as'] @args = ['args'] || [] end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
61 62 63 |
# File 'lib/vendor/celluloid/lib/celluloid/application.rb', line 61 def args @args end |
#as ⇒ Object (readonly)
Returns the value of attribute as.
61 62 63 |
# File 'lib/vendor/celluloid/lib/celluloid/application.rb', line 61 def as @as end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
61 62 63 |
# File 'lib/vendor/celluloid/lib/celluloid/application.rb', line 61 def klass @klass end |
Instance Method Details
#supervise ⇒ Object
73 74 75 |
# File 'lib/vendor/celluloid/lib/celluloid/application.rb', line 73 def supervise Supervisor.new_link(@as, @klass, *@args) end |