Class: Silicon::Routing::Route

Inherits:
Object
  • Object
show all
Defined in:
lib/silicon/routing/route.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#catchObject (readonly)

Returns the value of attribute catch.



4
5
6
# File 'lib/silicon/routing/route.rb', line 4

def catch
  @catch
end

#commandsObject (readonly)

Returns the value of attribute commands.



4
5
6
# File 'lib/silicon/routing/route.rb', line 4

def commands
  @commands
end

#http_statusObject (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_verbObject (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

#paramsObject (readonly)

Returns the value of attribute params.



4
5
6
# File 'lib/silicon/routing/route.rb', line 4

def params
  @params
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/silicon/routing/route.rb', line 4

def path
  @path
end

#segmentsObject (readonly)

Returns the value of attribute segments.



4
5
6
# File 'lib/silicon/routing/route.rb', line 4

def segments
  @segments
end

#viewObject (readonly)

Returns the value of attribute view.



4
5
6
# File 'lib/silicon/routing/route.rb', line 4

def view
  @view
end