Class: Hitman::Route

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, path) ⇒ Route

Returns a new instance of Route.



5
6
7
8
9
# File 'lib/hitman/route.rb', line 5

def initialize(method, path)
  @method = method
  @path = path
  @params = []
end

Instance Attribute Details

#methodObject

Returns the value of attribute method.



3
4
5
# File 'lib/hitman/route.rb', line 3

def method
  @method
end

#paramsObject

Returns the value of attribute params.



3
4
5
# File 'lib/hitman/route.rb', line 3

def params
  @params
end

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/hitman/route.rb', line 3

def path
  @path
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/hitman/route.rb', line 15

def to_s
  "#{method.ljust(10)} #{url.ljust(20)} #{params.join(', ')}"
end

#urlObject



11
12
13
# File 'lib/hitman/route.rb', line 11

def url
  path
end