Exception: CheeseCloth::MissingScopeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cheesecloth/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ MissingScopeError

Returns a new instance of MissingScopeError.



5
6
7
# File 'lib/cheesecloth/errors.rb', line 5

def initialize(klass)
  @klass = klass
end

Instance Method Details

#messageObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cheesecloth/errors.rb', line 9

def message
  "    Was unable to determine the base scope. Perhaps you forgot to call `scope`?\"\n\n    Try something like:\n\n    class \#{@klass.name || 'FooFilterer'}\n      include CheeseCloth\n\n      scope -> { Model.all }\n    end\n  MSG\nend\n".strip_heredoc