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