Class: BBK::App::Dispatcher::Result
- Inherits:
-
Object
- Object
- BBK::App::Dispatcher::Result
- Defined in:
- lib/bbk/app/dispatcher/result.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#route ⇒ Object
Returns the value of attribute route.
Instance Method Summary collapse
- #deconstruct ⇒ Object
- #deconstruct_keys(_keys) ⇒ Object
-
#initialize(route, message) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(route, message) ⇒ Result
Returns a new instance of Result.
8 9 10 11 12 13 14 |
# File 'lib/bbk/app/dispatcher/result.rb', line 8 def initialize(route, ) @route = route.is_a?(String) ? Dispatcher::Route.new(route) : route raise 'route must be of type Dispatcher::Route' unless @route.is_a?(Dispatcher::Route) @message = end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
6 7 8 |
# File 'lib/bbk/app/dispatcher/result.rb', line 6 def @message end |
#route ⇒ Object
Returns the value of attribute route.
6 7 8 |
# File 'lib/bbk/app/dispatcher/result.rb', line 6 def route @route end |
Instance Method Details
#deconstruct ⇒ Object
16 17 18 |
# File 'lib/bbk/app/dispatcher/result.rb', line 16 def deconstruct [route.to_s, ] end |
#deconstruct_keys(_keys) ⇒ Object
20 21 22 |
# File 'lib/bbk/app/dispatcher/result.rb', line 20 def deconstruct_keys(_keys) {route: route.to_s, message: } end |