Class: Searchlight::Search::UndefinedOption
- Defined in:
- lib/searchlight/search.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(option_name, search) ⇒ UndefinedOption
constructor
A new instance of UndefinedOption.
- #to_s ⇒ Object
Constructor Details
#initialize(option_name, search) ⇒ UndefinedOption
Returns a new instance of UndefinedOption.
100 101 102 103 104 105 106 107 108 |
# File 'lib/searchlight/search.rb', line 100 def initialize(option_name, search) option_name = option_name.to_s.sub(/=\Z/, '') self. = "#{search.class.name} doesn't search '#{option_name}' or have an accessor for that property." if option_name.start_with?('search_') method_maybe_intended = option_name.sub(/\Asearch_/, '') # Gee golly, I'm so helpful! self. << " Did you just mean '#{method_maybe_intended}'?" if search.respond_to?("#{method_maybe_intended}=") end end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
98 99 100 |
# File 'lib/searchlight/search.rb', line 98 def end |
Instance Method Details
#to_s ⇒ Object
110 111 112 |
# File 'lib/searchlight/search.rb', line 110 def to_s end |