Class: Mayu::Routing::Routes::Param
- Defined in:
- lib/mayu/routing/routes.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Route
Instance Method Summary collapse
-
#initialize(name, format: /\A\d+\z/) ⇒ Param
constructor
A new instance of Param.
- #match?(part) ⇒ Boolean
Methods inherited from Route
Constructor Details
#initialize(name, format: /\A\d+\z/) ⇒ Param
Returns a new instance of Param.
72 73 74 75 76 |
# File 'lib/mayu/routing/routes.rb', line 72 def initialize(name, format: /\A\d+\z/) super() @name = name @format = format end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
69 70 71 |
# File 'lib/mayu/routing/routes.rb', line 69 def format @format end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
67 68 69 |
# File 'lib/mayu/routing/routes.rb', line 67 def name @name end |
Instance Method Details
#match?(part) ⇒ Boolean
79 80 81 |
# File 'lib/mayu/routing/routes.rb', line 79 def match?(part) @format.match?(part) end |