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.
128 129 130 131 |
# File 'lib/sunspot_matchers/matchers.rb', line 128 def initialize(method, *args, &block) @method = method @args = (block.nil? ? args : [*args, block]) end |
Instance Method Details
#failure_message ⇒ Object
139 140 141 |
# File 'lib/sunspot_matchers/matchers.rb', line 139 def @matcher. end |
#failure_message_when_negated ⇒ Object
143 144 145 |
# File 'lib/sunspot_matchers/matchers.rb', line 143 def @matcher. end |
#get_matcher ⇒ Object
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/sunspot_matchers/matchers.rb', line 147 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
133 134 135 136 137 |
# File 'lib/sunspot_matchers/matchers.rb', line 133 def matches?(actual) @actual = actual @matcher = get_matcher.new(@actual, @args) @matcher.match? end |