lib/base_repo.rb
# Find the first row in a table matching some condition.
# Returns nil if it is not found.
#
# @param table_name [Symbol] the db table name.
# @param wrapper [Class] the class of the object to return.
# @param args [Hash] the where-clause conditions.
# @return [Object, nil] the row wrapped in a new wrapper object.
Find the first row in a table matching some condition.
Returns nil if it is not found.
Find the first row in a table matching some condition . Returns nil if it is not found .
def where(table_name, wrapper, args)
    hash = where_hash(table_name, args)
    return nil if hash.nil?
    wrapper.new(hash)
  end
def where ( table_name , wrapper , args ) hash = where_hash ( table_name , args ) return nil if hash . nil? wrapper . new ( hash ) end
Find the first row in a table matching some condition.
Find the first row in a table matching some condition .
the row wrapped in a new wrapper object.
the row wrapped in a new wrapper object .
Object, nil
table_name
the db table name.
the db table name .
wrapper
the class of the object to return.
the class of the object to return .
args
the where-clause conditions.
the where - clause conditions .