Class: Silicon::Routing::Route
- Inherits:
-
Object
- Object
- Silicon::Routing::Route
- Defined in:
- lib/silicon/routing/route.rb
Instance Attribute Summary collapse
-
#catch ⇒ Object
readonly
Returns the value of attribute catch.
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#http_verb ⇒ Object
readonly
Returns the value of attribute http_verb.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#segments ⇒ Object
readonly
Returns the value of attribute segments.
-
#view ⇒ Object
readonly
Returns the value of attribute view.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Route
constructor
A new instance of Route.
Constructor Details
#initialize(hash) ⇒ Route
Returns a new instance of Route.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/silicon/routing/route.rb', line 7 def initialize(hash) @http_verb = hash[:http_verb] @path = hash[:path].sub('.', '/').sub('//', '/') @params = hash[:params] @commands = hash[:commands] @view = hash[:view] @http_status = hash[:http_status] @segments = @path.split('/').concat(['/']) @catch = hash[:catch] end |
Instance Attribute Details
#catch ⇒ Object (readonly)
Returns the value of attribute catch.
4 5 6 |
# File 'lib/silicon/routing/route.rb', line 4 def catch @catch end |
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
4 5 6 |
# File 'lib/silicon/routing/route.rb', line 4 def commands @commands end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
4 5 6 |
# File 'lib/silicon/routing/route.rb', line 4 def http_status @http_status end |
#http_verb ⇒ Object (readonly)
Returns the value of attribute http_verb.
4 5 6 |
# File 'lib/silicon/routing/route.rb', line 4 def http_verb @http_verb end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/silicon/routing/route.rb', line 4 def params @params end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/silicon/routing/route.rb', line 4 def path @path end |
#segments ⇒ Object (readonly)
Returns the value of attribute segments.
4 5 6 |
# File 'lib/silicon/routing/route.rb', line 4 def segments @segments end |
#view ⇒ Object (readonly)
Returns the value of attribute view.
4 5 6 |
# File 'lib/silicon/routing/route.rb', line 4 def view @view end |