Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Removed more unecessary TODO: document comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dkubb committed Oct 24, 2009
1 parent ac19a70 commit 6bb3a9d
Show file tree
Hide file tree
Showing 32 changed files with 0 additions and 281 deletions.
1 change: 0 additions & 1 deletion lib/dm-core/adapters.rb
Expand Up @@ -126,7 +126,6 @@ def load_adapter(name)
end

extendable do
# TODO: document
# @api private
def const_added(const_name)
end
Expand Down
20 changes: 0 additions & 20 deletions lib/dm-core/adapters/data_objects_adapter.rb
Expand Up @@ -216,7 +216,6 @@ def delete(collection)

protected

# TODO: document
# @api private
def normalized_uri
@normalized_uri ||=
Expand Down Expand Up @@ -262,7 +261,6 @@ def close_connection(connection)

private

# TODO: document
# @api public
def initialize(name, uri_or_options)
super
Expand All @@ -273,14 +271,12 @@ def initialize(name, uri_or_options)
end
end

# TODO: document
# @api private
def connection_stack
connection_stack_for = Thread.current[:dm_do_connection_stack] ||= {}
connection_stack_for[self] ||= []
end

# TODO: document
# @api private
def with_connection
begin
Expand All @@ -298,7 +294,6 @@ def with_connection
module SQL #:nodoc:
IDENTIFIER_MAX_LENGTH = 128

# TODO: document
# @api semipublic
def property_to_column_name(property, qualify, qualifier = nil)
if qualify
Expand Down Expand Up @@ -492,13 +487,11 @@ def conditions_statement(conditions, qualify = false)
end
end

# TODO: document
# @api private
def supports_subquery?(*)
true
end

# TODO: document
# @api private
def subquery(*args)
if args.first.repository.name == name && supports_subquery?(*args)
Expand All @@ -508,7 +501,6 @@ def subquery(*args)
end
end

# TODO: document
# @api private
def subquery_statement(query, source_key, target_key, qualify)
query = query.merge(:fields => source_key, :unique => false)
Expand All @@ -526,7 +518,6 @@ def subquery_statement(query, source_key, target_key, qualify)
return statement, bind_values
end

# TODO: document
# @api private
def subquery_execute(query, source_key, target_key, qualify)
query = query.merge(:fields => source_key)
Expand Down Expand Up @@ -558,7 +549,6 @@ def order_statement(order, qualify, qualifier = nil)
statements.join(', ')
end

# TODO: document
# @api private
def negate_operation(operand, qualify)
@negated = !@negated
Expand All @@ -569,7 +559,6 @@ def negate_operation(operand, qualify)
end
end

# TODO: document
# @api private
def operation_statement(operation, qualify)
statements = []
Expand Down Expand Up @@ -652,19 +641,16 @@ def comparison_operator(comparison)
end
end

# TODO: document
# @api private
def equality_operator(property, operand)
operand.nil? ? 'IS' : '='
end

# TODO: document
# @api private
def inequality_operator(property, operand)
operand.nil? ? 'IS NOT' : '<>'
end

# TODO: document
# @api private
def include_operator(property, operand)
case operand
Expand All @@ -673,37 +659,31 @@ def include_operator(property, operand)
end
end

# TODO: document
# @api private
def exclude_operator(property, operand)
"NOT #{include_operator(property, operand)}"
end

# TODO: document
# @api private
def regexp_operator(operand)
'~'
end

# TODO: document
# @api private
def not_regexp_operator(operand)
'!~'
end

# TODO: document
# @api private
def like_operator(operand)
'LIKE'
end

# TODO: document
# @api private
def unlike_operator(operand)
'NOT LIKE'
end

# TODO: document
# @api private
def quote_name(name)
"\"#{name[0, self.class::IDENTIFIER_MAX_LENGTH].gsub('"', '""')}\""
Expand Down
5 changes: 0 additions & 5 deletions lib/dm-core/adapters/mysql_adapter.rb
Expand Up @@ -10,13 +10,11 @@ module SQL #:nodoc:

private

# TODO: document
# @api private
def supports_default_values? #:nodoc:
false
end

# TODO: document
# @api private
def supports_subquery?(query, source_key, target_key, qualify)
# TODO: renable once query does not include target_model for deletes and updates
Expand All @@ -25,19 +23,16 @@ def supports_subquery?(query, source_key, target_key, qualify)
false
end

# TODO: document
# @api private
def regexp_operator(operand)
'REGEXP'
end

# TODO: document
# @api private
def not_regexp_operator(operand)
'NOT REGEXP'
end

# TODO: document
# @api private
def quote_name(name)
"`#{name[0, self.class::IDENTIFIER_MAX_LENGTH].gsub('`', '``')}`"
Expand Down
6 changes: 0 additions & 6 deletions lib/dm-core/adapters/oracle_adapter.rb
Expand Up @@ -60,7 +60,6 @@ def default_values_clause
'VALUES (DEFAULT)'
end

# TODO: document
# @api private
def supports_returning?
true
Expand Down Expand Up @@ -164,7 +163,6 @@ def add_limit_offset!(statement, limit, offset, bind_values)
end
end

# TODO: document
# @api private
# Oracle does not allow " in table or column names therefore substitute them with underscore
def quote_name(name)
Expand Down Expand Up @@ -199,7 +197,6 @@ def inequality_operator(property, operand)
end
end

# TODO: document
# @api private
def include_operator(property, operand)
operator = case operand
Expand All @@ -213,7 +210,6 @@ def include_operator(property, operand)
end
end

# TODO: document
# @api private
def exclude_operator(property, operand)
operator = case operand
Expand All @@ -227,13 +223,11 @@ def exclude_operator(property, operand)
end
end

# TODO: document
# @api private
def regexp_operator(operand)
'REGEXP_LIKE(%s, ?)'
end

# TODO: document
# @api private
def not_regexp_operator(operand)
'NOT REGEXP_LIKE(%s, ?)'
Expand Down
1 change: 0 additions & 1 deletion lib/dm-core/adapters/postgres_adapter.rb
Expand Up @@ -8,7 +8,6 @@ class PostgresAdapter < DataObjectsAdapter
module SQL #:nodoc:
private

# TODO: document
# @api private
def supports_returning?
true
Expand Down
1 change: 0 additions & 1 deletion lib/dm-core/adapters/sqlite3_adapter.rb
Expand Up @@ -5,7 +5,6 @@
module DataMapper
module Adapters
class Sqlite3Adapter < DataObjectsAdapter
# TODO: document
# @api private
def supports_subquery?(query, source_key, target_key, qualify)
# SQLite3 cannot match a subquery against more than one column
Expand Down
2 changes: 0 additions & 2 deletions lib/dm-core/adapters/sqlserver_adapter.rb
Expand Up @@ -86,15 +86,13 @@ def add_limit_offset!(statement, limit, offset, bind_values)
end
end

# TODO: document
# @api private
# TODO: Not actually supported out of the box. Is theoretically possible
# via CLR integration, custom functions.
def regexp_operator(operand)
'REGEXP'
end

# TODO: document
# @api private
# TODO: Not actually supported out of the box. Is theoretically possible
# via CLR integration, custom functions.
Expand Down
5 changes: 0 additions & 5 deletions lib/dm-core/adapters/yaml_adapter.rb
Expand Up @@ -4,7 +4,6 @@
module DataMapper
module Adapters
class YamlAdapter < AbstractAdapter
# TODO: document
# @api semipublic
def create(resources)
update_records(resources.first.model) do |records|
Expand All @@ -15,13 +14,11 @@ def create(resources)
end
end

# TODO: document
# @api semipublic
def read(query)
query.filter_records(records_for(query.model).dup)
end

# TODO: document
# @api semipublic
def update(attributes, collection)
attributes = attributes_as_fields(attributes)
Expand All @@ -32,7 +29,6 @@ def update(attributes, collection)
end
end

# TODO: document
# @api semipublic
def delete(collection)
update_records(collection.model) do |records|
Expand All @@ -44,7 +40,6 @@ def delete(collection)

private

# TODO: document
# @api semipublic
def initialize(name, options = {})
super
Expand Down
9 changes: 0 additions & 9 deletions lib/dm-core/associations/many_to_one.rb
Expand Up @@ -6,27 +6,21 @@ module ManyToOne #:nodoc:
class Relationship < Associations::Relationship
OPTIONS = superclass::OPTIONS.dup << :nullable

# TODO: document
# @api semipublic
alias source_repository_name child_repository_name

# TODO: document
# @api semipublic
alias source_model child_model

# TODO: document
# @api semipublic
alias target_repository_name parent_repository_name

# TODO: document
# @api semipublic
alias target_model parent_model

# TODO: document
# @api semipublic
alias target_key parent_key

# TODO: document
# @api semipublic
def nullable?
@nullable
Expand Down Expand Up @@ -57,7 +51,6 @@ def child_key
@child_key = properties.class.new(child_key).freeze
end

# TODO: document
# @api semipublic
alias source_key child_key

Expand Down Expand Up @@ -187,7 +180,6 @@ def inverse_name
super || Extlib::Inflection.underscore(Extlib::Inflection.demodulize(source_model.name)).pluralize.to_sym
end

# TODO: document
# @api private
def child_key_options(parent_property)
options = parent_property.options.only(:length, :precision, :scale).update(:index => name, :nullable => nullable?)
Expand All @@ -199,7 +191,6 @@ def child_key_options(parent_property)
options
end

# TODO: document
# @api private
def child_properties
child_key.map { |property| property.name }
Expand Down

0 comments on commit 6bb3a9d

Please sign in to comment.