Class: Eastwood::Context::ActionRoute
- Inherits:
-
Struct
- Object
- Struct
- Eastwood::Context::ActionRoute
- Includes:
- RouteHelpers
- Defined in:
- lib/eastwood/context/action_route.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
-
#route ⇒ Object
Returns the value of attribute route.
Instance Method Summary collapse
- #coffee_args ⇒ Object
- #coffee_name ⇒ Object
- #coffee_path ⇒ Object
- #name ⇒ Object
- #parts ⇒ Object
- #path ⇒ Object
Methods included from RouteHelpers
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format
3 4 5 |
# File 'lib/eastwood/context/action_route.rb', line 3 def format @format end |
#route ⇒ Object
Returns the value of attribute route
3 4 5 |
# File 'lib/eastwood/context/action_route.rb', line 3 def route @route end |
Instance Method Details
#coffee_args ⇒ Object
22 23 24 |
# File 'lib/eastwood/context/action_route.rb', line 22 def coffee_args parts.any? ? "#{parts.join( ', ' )}='#{format}'" : '' end |
#coffee_name ⇒ Object
18 19 20 |
# File 'lib/eastwood/context/action_route.rb', line 18 def coffee_name style_for_javascript "#{name}_path" end |
#coffee_path ⇒ Object
26 27 28 |
# File 'lib/eastwood/context/action_route.rb', line 26 def coffee_path path.delete( '.' ).gsub /:(\w+)/, '#{\1}' end |
#name ⇒ Object
6 7 8 |
# File 'lib/eastwood/context/action_route.rb', line 6 def name route.name end |
#parts ⇒ Object
10 11 12 |
# File 'lib/eastwood/context/action_route.rb', line 10 def parts route.segment_keys end |
#path ⇒ Object
14 15 16 |
# File 'lib/eastwood/context/action_route.rb', line 14 def path route.path.delete '()' end |