# lib/sleeping_king_studios/shinkansen/models/queries/errors/not_implemented_error.rb

require 'sleeping_king_studios/shinkansen/errors'
require 'sleeping_king_studios/shinkansen/models/queries/errors'

module SleepingKingStudios::Shinkansen::Models::Queries::Errors
  class NotImplementedError < SleepingKingStudios::Shinkansen::Errors::BaseError
    def initialize query, method_name
      @query       = query
      @method_name = method_name
    end # method initialize

    attr_reader :method_name, :query

    def details
      ":#{method_name} is a valid query method, but it is not "\
      "implemented by #{query.class}."
    end # method details

    def problem
      "#{query.inspect} does not implement :#{method_name}."
    end # method problem

    def resolution
      'Select an alternate datastore, use another query method, or query the '\
      'datastore directly. You can also request the implementer of '\
      "#{query.class} to add support for the :#{method_name} method."
    end # method resolution
  end # class
end # class
