Class: Eastwood::Context::Route
- Inherits:
-
Struct
- Object
- Struct
- Eastwood::Context::Route
- Defined in:
- lib/eastwood/context.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
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format
4 5 6 |
# File 'lib/eastwood/context.rb', line 4 def format @format end |
#route ⇒ Object
Returns the value of attribute route
4 5 6 |
# File 'lib/eastwood/context.rb', line 4 def route @route end |
Instance Method Details
#coffee_args ⇒ Object
17 18 19 |
# File 'lib/eastwood/context.rb', line 17 def coffee_args parts.any? ? "#{parts.join( ', ' )}='#{format}'" : '' end |
#coffee_name ⇒ Object
14 15 16 |
# File 'lib/eastwood/context.rb', line 14 def coffee_name "#{name}_path" end |
#coffee_path ⇒ Object
20 21 22 |
# File 'lib/eastwood/context.rb', line 20 def coffee_path path.delete( '.' ).gsub /:(\w+)/, '#{\1}' end |
#name ⇒ Object
5 6 7 |
# File 'lib/eastwood/context.rb', line 5 def name route.name end |
#parts ⇒ Object
8 9 10 |
# File 'lib/eastwood/context.rb', line 8 def parts route.parts end |
#path ⇒ Object
11 12 13 |
# File 'lib/eastwood/context.rb', line 11 def path route.path.spec.to_s.delete '()' end |