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.
86 87 88 89 90 91 92 93 94 |
# File 'lib/searchlight/search.rb', line 86 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.
84 85 86 |
# File 'lib/searchlight/search.rb', line 84 def @message end |
Instance Method Details
#to_s ⇒ Object
96 97 98 |
# File 'lib/searchlight/search.rb', line 96 def to_s end |