Class: SunspotMatchers::HaveSearchParams
- Inherits:
-
Object
- Object
- SunspotMatchers::HaveSearchParams
- Defined in:
- lib/sunspot_matchers/matchers.rb
Instance Method Summary collapse
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ 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
126 127 128 129 |
# File 'lib/sunspot_matchers/matchers.rb', line 126 def initialize(method, *args, &block) @method = method @args = [*args, block].compact end |
Instance Method Details
#failure_message_for_should ⇒ Object
137 138 139 |
# File 'lib/sunspot_matchers/matchers.rb', line 137 def @matcher. end |
#failure_message_for_should_not ⇒ Object
141 142 143 |
# File 'lib/sunspot_matchers/matchers.rb', line 141 def @matcher. end |
#get_matcher ⇒ Object
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/sunspot_matchers/matchers.rb', line 145 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
131 132 133 134 135 |
# File 'lib/sunspot_matchers/matchers.rb', line 131 def matches?(actual) @actual = actual @matcher = get_matcher.new(@actual, @args) @matcher.match? end |