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

Commit

Permalink
Stripped whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Kubb committed Nov 27, 2008
1 parent d0647e7 commit 40fcf73
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
42 changes: 21 additions & 21 deletions lib/dm-core/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ module Model

##
# Creates a new Model class with default_storage_name +storage_name+
#
#
# If a block is passed, it will be eval'd in the context of the new Model
#
#
# @param [#to_s] storage_name
# the default_storage name to use for the new Model class
# @param [Proc] block
# a block that will be eval'd in the context of the new Model class
#
#
# @return [DataMapper::Model]
# the newly created Model class
#
#
# @api semipublic
def self.new(storage_name, &block)
model = Class.new
Expand Down Expand Up @@ -150,10 +150,10 @@ def field_naming_convention(repository_name = default_storage_name)
# the type to define this property ass
# @param [Hash(Symbol => String)] options
# a hash of available options
#
#
# @return [DataMapper::Property]
# the created Property
#
#
# @see DataMapper::Property
#
# @api public
Expand Down Expand Up @@ -208,7 +208,7 @@ def property(name, type, options = {})
# @param [Symbol, String] repository_name
# The name of the repository to use. Uses the default Repository
# if none is specified.
#
#
# @return [Array]
# A list of Properties defined on this Model in the given Repository
#
Expand All @@ -233,13 +233,13 @@ def properties(repository_name = default_repository_name)

##
# Gets the list of key fields for this Model in +repository_name+
#
#
# @param [String] repository_name
# The name of the Repository for which the key is to be reported
#
#
# @return [Array]
# The list of key fields for this Model in +repository_name+
#
#
# @api public
def key(repository_name = default_repository_name)
properties(repository_name).key
Expand All @@ -262,7 +262,7 @@ def identity_field(repository_name = default_repository_name)
#
# @param [Object] *key
# The primary key or keys to use for lookup
#
#
# @return [DataMapper::Resource]
# A single model that was found
# @return [NilClass]
Expand Down Expand Up @@ -357,7 +357,7 @@ def first_or_create(query, attributes = {})
#
# @param [Hash(Symbol => Object)] attributes
# hash of attributes to set
#
#
# @return [DataMapper::Resource]
# the newly created (and saved) Resource instance
#
Expand All @@ -370,15 +370,15 @@ def create(attributes = {})

##
# Copy a set of records from one repository to another.
#
#
# @param [String] source
# The name of the Repository the resources should be copied _from_
# @param [String] destination
# The name of the Repository the resources should be copied _to_
# @param [Hash] query
# The conditions with which to find the records to copy. These
# conditions are merged with Model.query
#
#
# @return [DataMapper::Collection]
# A Collection of the Resource instances copied in the operation
#
Expand All @@ -394,13 +394,13 @@ def copy(source, destination, query = {})
##
# Loads an instance of this Model, taking into account IdentityMap lookup,
# inheritance columns(s) and Property typecasting.
#
#
# @param [Array(Object)] values
# an Array of values to load as the instance's values
#
#
# @return [DataMapper::Resource]
# the loaded Resource instance
#
#
# @api semipublic
def load(values, query)
repository = query.repository
Expand Down Expand Up @@ -504,13 +504,13 @@ def repository(name = nil)
end

# Get the current +repository_name+ for this Model.
#
#
# If there are any Repository contexts, the name of the last one will
# be returned, else the +default_repository_name+ of this model will be
#
#
# @return [String]
# the current repository name to use for this Model
#
#
# @api private
def repository_name
Repository.context.any? ? Repository.context.last.name : default_repository_name
Expand All @@ -519,7 +519,7 @@ def repository_name
# TODO: document
# Gets the current Set of repositories for which
# this Model has been defined (beyond default)
#
#
# @return [Set]
# The Set of repositories for which this Model
# has been defined (beyond default)
Expand Down
22 changes: 11 additions & 11 deletions lib/dm-core/property.rb
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,10 @@ def hash
#
# @param [Object] o
# the object to compare self to
#
#
# @return [TrueClass, FalseClass]
# Result of equality comparison.
#
#
# @api public
def eql?(o)
if o.is_a?(Property)
Expand All @@ -431,7 +431,7 @@ def eql?(o)
#
# @return [Integer, NilClass]
# the maximum length of this property
#
#
# @api semipublic
def length
@length.is_a?(Range) ? @length.max : @length
Expand Down Expand Up @@ -663,7 +663,7 @@ def lazy_load(resource)
#
# @param [#to_s, #to_f, #to_i] value
# the value to be typecast to this property's primitive
#
#
# @return [TrueClass, String, Float, Integer, BigDecimal, DateTime, Date, Time, Class]
# The typecasted +value+
#
Expand Down Expand Up @@ -834,7 +834,7 @@ def initialize(model, name, type, options = {})
end

# Assert given visibility value is supported.
#
#
# Will raise ArgumentError if this Property's reader and writer
# visibilities are not included in VISIBILITY_OPTIONS.
# @return [NilClass]
Expand Down Expand Up @@ -871,7 +871,7 @@ def typecast_to_datetime(value)
#
# @param [Hash, #to_s] value
# value to be typecast to Date
#
#
# @return [Date]
# Value type casted to Date
#
Expand All @@ -890,7 +890,7 @@ def typecast_to_date(value)
# value to be typecast to Time. Hash objects will be passed to
# #typecast_hash_to_time, anything else will have
# +Time.parse(value.to_s)+ called
#
#
# @return [Time]
# +value+ typecasted to Time
#
Expand All @@ -907,7 +907,7 @@ def typecast_to_time(value)
#
# @param [Hash] hash
# hash to be typecast to DateTime
#
#
# @return [DateTime]
# DateTime object constructed from a Hash.
#
Expand All @@ -924,7 +924,7 @@ def typecast_hash_to_datetime(hash)
#
# @param [Hash] hash
# hash to be typecast to Date
#
#
# @return [Date]
# Date object constructed from a Hash.
#
Expand All @@ -942,7 +942,7 @@ def typecast_hash_to_date(hash)
#
# @param [Hash] hash
# hash to be typecast to Time
#
#
# @return [Time]
# Time object constructed from a Hash.
#
Expand All @@ -959,7 +959,7 @@ def typecast_hash_to_time(hash)
# hash to extract time args from
# @param [Hash] args
# time args to extract from +hash+
#
#
# @return [Array]
# Extracted values
#
Expand Down
2 changes: 1 addition & 1 deletion lib/dm-core/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def new_record?
#
# @return [Hash]
# All the (non)-lazy attributes
#
#
# @api public
def attributes
attributes = {}
Expand Down

0 comments on commit 40fcf73

Please sign in to comment.