class YeSQL::Errors::OutputArgumentError

Constants

OPTIONS

Attributes

output[R]

Public Class Methods

new(output) click to toggle source
# File lib/yesql/errors/output_argument_error.rb, line 6
def initialize(output)
  @output = output
end

Public Instance Methods

validate_output_options() click to toggle source
# File lib/yesql/errors/output_argument_error.rb, line 10
def validate_output_options
  return if output.nil?
  return if OPTIONS.include?(output.to_sym)

  raise ArgumentError, message
end

Private Instance Methods

message() click to toggle source
# File lib/yesql/errors/output_argument_error.rb, line 24
      def message
"Unsupported `output` option given `#{output}`. Possible values are:
  - `columns`: returns an array with the columns from the result.
  - `hash`: returns an array of hashes combining both, the columns and rows from the statement result.
  - `rows`: returns an array of arrays for each row from the given SQL statement.\n"
      end