Exception: NoBrainer::Error::CannotUseIndex

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/no_brainer/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index_name) ⇒ CannotUseIndex

Returns a new instance of CannotUseIndex.



63
64
65
# File 'lib/no_brainer/error.rb', line 63

def initialize(index_name)
  @index_name = index_name
end

Instance Attribute Details

#index_nameObject

Returns the value of attribute index_name.



62
63
64
# File 'lib/no_brainer/error.rb', line 62

def index_name
  @index_name
end

Instance Method Details

#messageObject



67
68
69
70
71
72
73
# File 'lib/no_brainer/error.rb', line 67

def message
  if index_name == true
    "Cannot use any indexes"
  else
    "Cannot use index #{index_name}"
  end
end