Class: Qs::Route
- Inherits:
-
Object
- Object
- Qs::Route
- Defined in:
- lib/qs/route.rb
Instance Attribute Summary collapse
-
#handler_class ⇒ Object
readonly
Returns the value of attribute handler_class.
-
#handler_class_name ⇒ Object
readonly
Returns the value of attribute handler_class_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(route_id, handler_class_name) ⇒ Route
constructor
A new instance of Route.
- #run(message, daemon_data) ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(route_id, handler_class_name) ⇒ Route
Returns a new instance of Route.
9 10 11 12 13 |
# File 'lib/qs/route.rb', line 9 def initialize(route_id, handler_class_name) @id = route_id.to_s @handler_class_name = handler_class_name @handler_class = nil end |
Instance Attribute Details
#handler_class ⇒ Object (readonly)
Returns the value of attribute handler_class.
7 8 9 |
# File 'lib/qs/route.rb', line 7 def handler_class @handler_class end |
#handler_class_name ⇒ Object (readonly)
Returns the value of attribute handler_class_name.
7 8 9 |
# File 'lib/qs/route.rb', line 7 def handler_class_name @handler_class_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/qs/route.rb', line 7 def id @id end |
Instance Method Details
#run(message, daemon_data) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/qs/route.rb', line 19 def run(, daemon_data) QsRunner.new(self.handler_class, { :message => , :params => .params, :logger => daemon_data.logger }).run end |
#validate! ⇒ Object
15 16 17 |
# File 'lib/qs/route.rb', line 15 def validate! @handler_class = constantize_handler_class(@handler_class_name) end |