Class: Hanami::Router::Prefix Private
- Inherits:
-
Object
- Object
- Hanami::Router::Prefix
- Defined in:
- lib/hanami/router/prefix.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
URL Path prefix
Instance Method Summary collapse
-
#initialize(prefix) ⇒ Prefix
constructor
private
A new instance of Prefix.
- #join(path) ⇒ Object private
- #relative_join(path, separator = DEFAULT_SEPARATOR) ⇒ Object private
- #to_s ⇒ Object private
- #to_sym ⇒ Object private
Constructor Details
#initialize(prefix) ⇒ Prefix
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Prefix.
12 13 14 |
# File 'lib/hanami/router/prefix.rb', line 12 def initialize(prefix) @prefix = prefix end |
Instance Method Details
#join(path) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 21 22 |
# File 'lib/hanami/router/prefix.rb', line 18 def join(path) self.class.new( _join(path) ) end |
#relative_join(path, separator = DEFAULT_SEPARATOR) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 29 |
# File 'lib/hanami/router/prefix.rb', line 26 def relative_join(path, separator = DEFAULT_SEPARATOR) _join(path.to_s) .gsub(DEFAULT_SEPARATOR_REGEXP, separator)[1..] end |
#to_s ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'lib/hanami/router/prefix.rb', line 33 def to_s @prefix end |
#to_sym ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/hanami/router/prefix.rb', line 39 def to_sym @prefix.to_sym end |