Class: Eastwood::Context::ClientRoute
- Inherits:
-
Struct
- Object
- Struct
- Eastwood::Context::ClientRoute
- Includes:
- RouteHelpers
- Defined in:
- lib/eastwood/context/client_route.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#route ⇒ Object
Returns the value of attribute route.
-
#suffix ⇒ Object
Returns the value of attribute suffix.
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
#key ⇒ Object
Returns the value of attribute key
3 4 5 |
# File 'lib/eastwood/context/client_route.rb', line 3 def key @key end |
#route ⇒ Object
Returns the value of attribute route
3 4 5 |
# File 'lib/eastwood/context/client_route.rb', line 3 def route @route end |
#suffix ⇒ Object
Returns the value of attribute suffix
3 4 5 |
# File 'lib/eastwood/context/client_route.rb', line 3 def suffix @suffix end |
Instance Method Details
#coffee_args ⇒ Object
22 23 24 |
# File 'lib/eastwood/context/client_route.rb', line 22 def coffee_args parts.join ', ' end |
#coffee_name ⇒ Object
18 19 20 |
# File 'lib/eastwood/context/client_route.rb', line 18 def coffee_name style_for_javascript "#{name}_#{suffix}" end |
#coffee_path ⇒ Object
26 27 28 |
# File 'lib/eastwood/context/client_route.rb', line 26 def coffee_path path.gsub /:(\w+)/, '#{\1}' end |
#name ⇒ Object
6 7 8 |
# File 'lib/eastwood/context/client_route.rb', line 6 def name key.to_s end |
#parts ⇒ Object
10 11 12 |
# File 'lib/eastwood/context/client_route.rb', line 10 def parts route.scan( /:(\w+)/ ).flatten.map &:to_sym end |
#path ⇒ Object
14 15 16 |
# File 'lib/eastwood/context/client_route.rb', line 14 def path route end |