Class: Swee::Routes::RouteStruct
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#request_methods ⇒ Object
readonly
Returns the value of attribute request_methods.
Instance Method Summary collapse
- #controller_name ⇒ Object
- #create_controller_instance ⇒ Object
-
#initialize(c, a, m) ⇒ RouteStruct
constructor
A new instance of RouteStruct.
Constructor Details
#initialize(c, a, m) ⇒ RouteStruct
Returns a new instance of RouteStruct.
7 8 9 |
# File 'lib/swee/routes.rb', line 7 def initialize c,a,m @controller,@action,@request_methods = c,a,m end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
6 7 8 |
# File 'lib/swee/routes.rb', line 6 def action @action end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
6 7 8 |
# File 'lib/swee/routes.rb', line 6 def controller @controller end |
#request_methods ⇒ Object (readonly)
Returns the value of attribute request_methods.
6 7 8 |
# File 'lib/swee/routes.rb', line 6 def request_methods @request_methods end |
Instance Method Details
#controller_name ⇒ Object
11 12 13 |
# File 'lib/swee/routes.rb', line 11 def controller_name "#{controller[0].upcase+controller[1..controller.size-1]}Controller" end |
#create_controller_instance ⇒ Object
15 16 17 |
# File 'lib/swee/routes.rb', line 15 def create_controller_instance eval "#{controller_name}.new" end |