Class: Sinatra::Reloader::Route

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra/reloader.rb

Overview

Represents a Sinatra route.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Route) initialize(attrs = {})

Creates a new Route instance, it expects a hash with the Sinatra application (:app key), the file in which the route is defined (:source_location key), its verb (:verb key) and its signature, or, in other words, the array used internally by Sinatra to identify the route (:signature key).



20
21
22
23
24
25
# File 'lib/sinatra/reloader.rb', line 20

def initialize(attrs={})
  self.app             = attrs[:app]
  self.source_location = attrs[:source_location]
  self.verb            = attrs[:verb]
  self.signature       = attrs[:signature]
end

Instance Attribute Details

- (Object) app

Returns the value of attribute app



12
13
14
# File 'lib/sinatra/reloader.rb', line 12

def app
  @app
end

- (Object) signature

Returns the value of attribute signature



12
13
14
# File 'lib/sinatra/reloader.rb', line 12

def signature
  @signature
end

- (Object) source_location

Returns the value of attribute source_location



12
13
14
# File 'lib/sinatra/reloader.rb', line 12

def source_location
  @source_location
end

- (Object) verb

Returns the value of attribute verb



12
13
14
# File 'lib/sinatra/reloader.rb', line 12

def verb
  @verb
end