Class: Jetski::Router::Host::Base
- Inherits:
-
Object
- Object
- Jetski::Router::Host::Base
- Defined in:
- lib/jetski/router/host/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#action_name ⇒ Object
readonly
Returns the value of attribute action_name.
-
#all_server_options ⇒ Object
readonly
Returns the value of attribute all_server_options.
-
#controller_class ⇒ Object
readonly
Returns the value of attribute controller_class.
-
#controller_classname ⇒ Object
readonly
Returns the value of attribute controller_classname.
-
#controller_file_name ⇒ Object
readonly
Returns the value of attribute controller_file_name.
-
#controller_name ⇒ Object
readonly
Returns the value of attribute controller_name.
-
#controller_path ⇒ Object
readonly
Returns the value of attribute controller_path.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#req ⇒ Object
Returns the value of attribute req.
-
#request_method ⇒ Object
readonly
Returns the value of attribute request_method.
-
#res ⇒ Object
Returns the value of attribute res.
-
#served_url ⇒ Object
readonly
Returns the value of attribute served_url.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(server, **server_options) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(server, **server_options) ⇒ Base
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/jetski/router/host/base.rb', line 11 def initialize(server, **) @server = server @errors = [] = @served_url = [:url] @request_method = [:method] @controller_file_name = [:controller_file_name] @controller_path = [:controller_path] @controller_classname = [:controller_classname] @controller_name = [:controller_name] @action_name = [:action_name] end |
Instance Attribute Details
#action_name ⇒ Object (readonly)
Returns the value of attribute action_name.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def action_name @action_name end |
#all_server_options ⇒ Object (readonly)
Returns the value of attribute all_server_options.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def end |
#controller_class ⇒ Object (readonly)
Returns the value of attribute controller_class.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def controller_class @controller_class end |
#controller_classname ⇒ Object (readonly)
Returns the value of attribute controller_classname.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def controller_classname @controller_classname end |
#controller_file_name ⇒ Object (readonly)
Returns the value of attribute controller_file_name.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def controller_file_name @controller_file_name end |
#controller_name ⇒ Object (readonly)
Returns the value of attribute controller_name.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def controller_name @controller_name end |
#controller_path ⇒ Object (readonly)
Returns the value of attribute controller_path.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def controller_path @controller_path end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def errors @errors end |
#req ⇒ Object
Returns the value of attribute req.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def req @req end |
#request_method ⇒ Object (readonly)
Returns the value of attribute request_method.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def request_method @request_method end |
#res ⇒ Object
Returns the value of attribute res.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def res @res end |
#served_url ⇒ Object (readonly)
Returns the value of attribute served_url.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def served_url @served_url end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
5 6 7 |
# File 'lib/jetski/router/host/base.rb', line 5 def server @server end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jetski/router/host/base.rb', line 24 def call server.mount_proc served_url do |req, res| @req = req @res = res check_request_url yield if errors.any? res.body = errors.join(", ") end end end |