Skip to content
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.

Commit

Permalink
Added missing YARD tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Jul 25, 2011
1 parent d5440fe commit e3edd5f
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion lib/dm-is-predefined/is/predefined.rb
Expand Up @@ -10,6 +10,8 @@ module Predefined
# If the model already includes `DataMapper::Migrations`, then
# {MigrationMethods} will be extended into the Model.
#
# @api private
#
def is_predefined
extend DataMapper::Is::Predefined::ClassMethods

Expand All @@ -19,6 +21,9 @@ def is_predefined
end
end

#
# @since 0.4.0
#
module MigrationMethods
#
# Auto-migrates the model, then creates all predefined resources.
Expand All @@ -28,6 +33,8 @@ module MigrationMethods
#
# @return [true]
#
# @api public
#
def auto_migrate!(repository_name=self.repository_name)
result = super(repository_name)

Expand All @@ -41,13 +48,16 @@ def auto_migrate!(repository_name=self.repository_name)
end

#
# Auto-upgrades the model, then creates any missing predefined resources.
# Auto-upgrades the model, then creates any missing predefined
# resources.
#
# @param [Symbol] repository_name
# The repository to perform the upgrade within.
#
# @return [true]
#
# @api public
#
def auto_upgrade!(repository_name=self.repository_name)
result = super(repository_name)

Expand All @@ -68,6 +78,8 @@ module ClassMethods
# @return [Hash{Symbol => Hash}]
# The Hash of pre-defined resources and their attributes.
#
# @api semipublic
#
def predefined_attributes
@predefined_attributes ||= {}
end
Expand All @@ -80,6 +92,8 @@ def predefined_attributes
#
# @since 0.4.0
#
# @api public
#
def predefined
predefined_attributes.keys
end
Expand All @@ -106,6 +120,8 @@ def predefined_names
#
# @since 0.4.0
#
# @api public
#
def predefined?(name)
predefined_attributes.has_key?(name.to_sym)
end
Expand All @@ -129,6 +145,8 @@ def predefined?(name)
#
# @since 0.2.1
#
# @api public
#
def predefined_resource(name)
name = name.to_sym

Expand Down Expand Up @@ -156,6 +174,8 @@ def predefined_resource(name)
#
# @since 0.4.0
#
# @api public
#
def first_predefined_resource(query={})
if (resource = first(query))
return resource
Expand Down Expand Up @@ -223,6 +243,8 @@ def get(key)
# The attributes that will be assigned to the pre-defined
# resource.
#
# @api public
#
def predefine(name,attributes={})
name = name.to_sym

Expand Down

0 comments on commit e3edd5f

Please sign in to comment.