Class: SunspotMatchers::HaveSearchParams
- Inherits:
-
Object
- Object
- SunspotMatchers::HaveSearchParams
- Defined in:
- lib/sunspot_matchers/matchers.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
- #get_matcher ⇒ Object
-
#initialize(method, *args, &block) ⇒ HaveSearchParams
constructor
A new instance of HaveSearchParams.
- #matches?(actual) ⇒ Boolean
Constructor Details
#initialize(method, *args, &block) ⇒ HaveSearchParams
Returns a new instance of HaveSearchParams.
127 128 129 130 |
# File 'lib/sunspot_matchers/matchers.rb', line 127 def initialize(method, *args, &block) @method = method @args = [*args, block].compact end |
Instance Method Details
#failure_message ⇒ Object
138 139 140 |
# File 'lib/sunspot_matchers/matchers.rb', line 138 def @matcher. end |
#failure_message_when_negated ⇒ Object
142 143 144 |
# File 'lib/sunspot_matchers/matchers.rb', line 142 def @matcher. end |
#get_matcher ⇒ Object
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/sunspot_matchers/matchers.rb', line 146 def get_matcher case @method when :with WithMatcher when :without WithoutMatcher when :keywords, :fulltext KeywordsMatcher when :boost BoostMatcher when :facet FacetMatcher when :order_by OrderByMatcher when :paginate PaginationMatcher when :group GroupMatcher end end |
#matches?(actual) ⇒ Boolean
132 133 134 135 136 |
# File 'lib/sunspot_matchers/matchers.rb', line 132 def matches?(actual) @actual = actual @matcher = get_matcher.new(@actual, @args) @matcher.match? end |