Class: Journey::Router::Strexp
- Inherits:
-
Object
- Object
- Journey::Router::Strexp
- Defined in:
- lib/journey/router/strexp.rb
Instance Attribute Summary collapse
-
#anchor ⇒ Object
readonly
Returns the value of attribute anchor.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#requirements ⇒ Object
readonly
Returns the value of attribute requirements.
-
#separators ⇒ Object
readonly
Returns the value of attribute separators.
Instance Method Summary collapse
-
#initialize(path, requirements, separators, anchor = true) ⇒ Strexp
constructor
A new instance of Strexp.
- #names ⇒ Object
Constructor Details
#initialize(path, requirements, separators, anchor = true) ⇒ Strexp
Returns a new instance of Strexp.
10 11 12 13 14 15 |
# File 'lib/journey/router/strexp.rb', line 10 def initialize path, requirements, separators, anchor = true @path = path @requirements = requirements @separators = separators @anchor = anchor end |
Instance Attribute Details
#anchor ⇒ Object (readonly)
Returns the value of attribute anchor.
8 9 10 |
# File 'lib/journey/router/strexp.rb', line 8 def anchor @anchor end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/journey/router/strexp.rb', line 8 def path @path end |
#requirements ⇒ Object (readonly)
Returns the value of attribute requirements.
8 9 10 |
# File 'lib/journey/router/strexp.rb', line 8 def requirements @requirements end |
#separators ⇒ Object (readonly)
Returns the value of attribute separators.
8 9 10 |
# File 'lib/journey/router/strexp.rb', line 8 def separators @separators end |
Instance Method Details
#names ⇒ Object
17 18 19 |
# File 'lib/journey/router/strexp.rb', line 17 def names @path.scan(/:\w+/).map { |s| s.tr(':', '') } end |