Class: Hitman::Route
- Inherits:
-
Object
- Object
- Hitman::Route
- Defined in:
- lib/hitman/route.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
Returns the value of attribute method.
-
#params ⇒ Object
Returns the value of attribute params.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(method, path) ⇒ Route
constructor
A new instance of Route.
- #to_s ⇒ Object
- #url ⇒ Object
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
#method ⇒ Object
Returns the value of attribute method.
3 4 5 |
# File 'lib/hitman/route.rb', line 3 def method @method end |
#params ⇒ Object
Returns the value of attribute params.
3 4 5 |
# File 'lib/hitman/route.rb', line 3 def params @params end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/hitman/route.rb', line 3 def path @path end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/hitman/route.rb', line 15 def to_s "#{method.ljust(10)} #{url.ljust(20)} #{params.join(', ')}" end |
#url ⇒ Object
11 12 13 |
# File 'lib/hitman/route.rb', line 11 def url path end |