module StaticRecord # The main gate for the model class methods. module GatewayModel def all records end def find(*ids) context = records.select { |c| ids.include? c.id } raise RecordNotFound.new( "Couldn't find #{to_s.tableize} with an out of range value for id.", to_s.tableize, 'id' ) if context.empty? return context.first if ids.length == 1 context end private def records load @records end end end