Class: YeSQL::Errors::NoBindingsProvidedError

Inherits:
Object
  • Object
show all
Includes:
Utils::Read
Defined in:
lib/yesql/errors/no_bindings_provided_error.rb

Instance Method Summary collapse

Methods included from Utils::Read

#statement

Constructor Details

#initialize(binds, file_path) ⇒ NoBindingsProvidedError

Returns a new instance of NoBindingsProvidedError.



10
11
12
13
# File 'lib/yesql/errors/no_bindings_provided_error.rb', line 10

def initialize(binds, file_path)
  @binds = binds
  @file_path = file_path
end

Instance Method Details

#validate_statement_bindingsObject

Raises:

  • (::ArgumentError)


15
16
17
18
19
20
# File 'lib/yesql/errors/no_bindings_provided_error.rb', line 15

def validate_statement_bindings
  return if statement_binds.size.zero?
  return if expected_binds?

  raise ::ArgumentError, message
end