Class: CheckPlease::PathSegmentMatcher
- Inherits:
-
Object
- Object
- CheckPlease::PathSegmentMatcher
- Defined in:
- lib/check_please/path_segment_matcher.rb
Instance Attribute Summary collapse
-
#a ⇒ Object
readonly
Returns the value of attribute a.
-
#b ⇒ Object
readonly
Returns the value of attribute b.
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(a, b) ⇒ PathSegmentMatcher
constructor
A new instance of PathSegmentMatcher.
Constructor Details
#initialize(a, b) ⇒ PathSegmentMatcher
Returns a new instance of PathSegmentMatcher.
9 10 11 12 |
# File 'lib/check_please/path_segment_matcher.rb', line 9 def initialize(a, b) @a, @b = a, b @types = [ _type(a), _type(b) ].sort end |
Instance Attribute Details
#a ⇒ Object (readonly)
Returns the value of attribute a.
8 9 10 |
# File 'lib/check_please/path_segment_matcher.rb', line 8 def a @a end |
#b ⇒ Object (readonly)
Returns the value of attribute b.
8 9 10 |
# File 'lib/check_please/path_segment_matcher.rb', line 8 def b @b end |
#types ⇒ Object (readonly)
Returns the value of attribute types.
8 9 10 |
# File 'lib/check_please/path_segment_matcher.rb', line 8 def types @types end |
Class Method Details
.call(a, b) ⇒ Object
4 5 6 |
# File 'lib/check_please/path_segment_matcher.rb', line 4 def self.call(a,b) new(a,b).call end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/check_please/path_segment_matcher.rb', line 14 def call return true if either?(:splat) return a.name == b.name if both?(:plain) return a.key == b.key if key_and_key_value? false end |