Class: Camping::CommandsHelpers::Route
- Defined in:
- lib/camping/commands.rb,
lib/camping/commands.rb
Overview
Route Struct, for making and formatting a route.
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#controller ⇒ Object
Returns the value of attribute controller.
-
#http_method ⇒ Object
Returns the value of attribute http_method.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #app_header ⇒ Object
- #controller_header ⇒ Object
-
#padded_message(with_method = false) ⇒ Object
pad the controller name to be the right length, if we can.
- #to_s ⇒ Object
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app
57 58 59 |
# File 'lib/camping/commands.rb', line 57 def app @app end |
#controller ⇒ Object
Returns the value of attribute controller
57 58 59 |
# File 'lib/camping/commands.rb', line 57 def controller @controller end |
#http_method ⇒ Object
Returns the value of attribute http_method
57 58 59 |
# File 'lib/camping/commands.rb', line 57 def http_method @http_method end |
#url ⇒ Object
Returns the value of attribute url
57 58 59 |
# File 'lib/camping/commands.rb', line 57 def url @url end |
Instance Method Details
#app_header ⇒ Object
69 70 71 |
# File 'lib/camping/commands.rb', line 69 def app_header "#{app.to_s}" end |
#controller_header ⇒ Object
73 74 75 |
# File 'lib/camping/commands.rb', line 73 def controller_header "#{pad}#{app.to_s}::#{controller.to_s}" end |
#padded_message(with_method = false) ⇒ Object
pad the controller name to be the right length, if we can.
65 66 67 |
# File 'lib/camping/commands.rb', line 65 def (with_method = false) "#{pad}#{(with_method ? http_method.to_s.upcase.ljust(pad.length, " ") : pad)}#{replace_reg url}" end |
#to_s ⇒ Object
60 61 62 |
# File 'lib/camping/commands.rb', line 60 def to_s "#{controller}: #{http_method}: #{url} - #{replace_reg url}" end |