Class: OpenAPISourceTools::Ordering::KeyPattern
- Inherits:
-
Object
- Object
- OpenAPISourceTools::Ordering::KeyPattern
- Defined in:
- lib/openapi/sourcetools/order.rb
Overview
Book-keeping class for pattern and its location.
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
Instance Method Summary collapse
- #any? ⇒ Boolean
-
#initialize(pattern, index, priority) ⇒ KeyPattern
constructor
A new instance of KeyPattern.
- #match?(string) ⇒ Boolean
Constructor Details
#initialize(pattern, index, priority) ⇒ KeyPattern
Returns a new instance of KeyPattern.
140 141 142 143 144 |
# File 'lib/openapi/sourcetools/order.rb', line 140 def initialize(pattern, index, priority) @pattern = pattern @index = index @priority = priority end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
138 139 140 |
# File 'lib/openapi/sourcetools/order.rb', line 138 def index @index end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
138 139 140 |
# File 'lib/openapi/sourcetools/order.rb', line 138 def pattern @pattern end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
138 139 140 |
# File 'lib/openapi/sourcetools/order.rb', line 138 def priority @priority end |
Instance Method Details
#any? ⇒ Boolean
150 151 152 |
# File 'lib/openapi/sourcetools/order.rb', line 150 def any? @index != @priority end |
#match?(string) ⇒ Boolean
146 147 148 |
# File 'lib/openapi/sourcetools/order.rb', line 146 def match?(string) @pattern.match?(string) end |