Class: Eastwood::Context::HashRoute
- Inherits:
-
Struct
- Object
- Struct
- Eastwood::Context::HashRoute
- Defined in:
- lib/eastwood/context.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
Instance Attribute Details
#hash ⇒ Object
Returns the value of attribute hash
25 26 27 |
# File 'lib/eastwood/context.rb', line 25 def hash @hash end |
#key ⇒ Object
Returns the value of attribute key
25 26 27 |
# File 'lib/eastwood/context.rb', line 25 def key @key end |
Instance Method Details
#coffee_args ⇒ Object
38 39 40 |
# File 'lib/eastwood/context.rb', line 38 def coffee_args parts.join ', ' end |
#coffee_name ⇒ Object
35 36 37 |
# File 'lib/eastwood/context.rb', line 35 def coffee_name "#{name}_hash" end |
#coffee_path ⇒ Object
41 42 43 |
# File 'lib/eastwood/context.rb', line 41 def coffee_path path.gsub /:(\w+)/, '#{\1}' end |
#name ⇒ Object
26 27 28 |
# File 'lib/eastwood/context.rb', line 26 def name key.to_s end |
#parts ⇒ Object
29 30 31 |
# File 'lib/eastwood/context.rb', line 29 def parts hash.scan( /:(\w+)/ ).flatten.map &:to_sym end |
#path ⇒ Object
32 33 34 |
# File 'lib/eastwood/context.rb', line 32 def path hash end |