Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add :nodoc: to internal implementations [ci skip] #6853

Merged
merged 1 commit into from
Jun 25, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module ActiveModel
module MassAssignmentSecurity
class PermissionSet < Set
class PermissionSet < Set #:nodoc:

def +(values)
super(values.compact.map(&:to_s))
Expand All @@ -23,14 +23,14 @@ def remove_multiparameter_id(key)
end
end

class WhiteList < PermissionSet
class WhiteList < PermissionSet #:nodoc:

def deny?(key)
!include?(key)
end
end

class BlackList < PermissionSet
class BlackList < PermissionSet #:nodoc:

def deny?(key)
include?(key)
Expand Down
4 changes: 2 additions & 2 deletions activemodel/lib/active_model/validations/acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ActiveModel

# == Active Model Acceptance Validator
module Validations
class AcceptanceValidator < EachValidator
class AcceptanceValidator < EachValidator #:nodoc:
def initialize(options)
super(options.reverse_merge(:allow_nil => true, :accept => "1"))
end
Expand Down Expand Up @@ -58,7 +58,7 @@ module HelperMethods
# <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).
# The method, proc or string should return or evaluate to a true or
# false value.
# * <tt>:strict</tt> - Specifies whether validation should be strict.
# * <tt>:strict</tt> - Specifies whether validation should be strict.
# See <tt>ActiveModel::Validation#validates!</tt> for more information.
def validates_acceptance_of(*attr_names)
validates_with AcceptanceValidator, _merge_attributes(attr_names)
Expand Down
4 changes: 2 additions & 2 deletions activemodel/lib/active_model/validations/confirmation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ActiveModel

# == Active Model Confirmation Validator
module Validations
class ConfirmationValidator < EachValidator
class ConfirmationValidator < EachValidator #:nodoc:
def validate_each(record, attribute, value)
if (confirmed = record.send("#{attribute}_confirmation")) && (value != confirmed)
human_attribute_name = record.class.human_attribute_name(attribute)
Expand Down Expand Up @@ -59,7 +59,7 @@ module HelperMethods
# <tt>:unless => :skip_validation</tt>, or
# <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>). The
# method, proc or string should return or evaluate to a true or false value.
# * <tt>:strict</tt> - Specifies whether validation should be strict.
# * <tt>:strict</tt> - Specifies whether validation should be strict.
# See <tt>ActiveModel::Validation#validates!</tt> for more information.
def validates_confirmation_of(*attr_names)
validates_with ConfirmationValidator, _merge_attributes(attr_names)
Expand Down
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/validations/exclusion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module ActiveModel

# == Active Model Exclusion Validator
module Validations
class ExclusionValidator < EachValidator
class ExclusionValidator < EachValidator #:nodoc:
include Clusivity

def validate_each(record, attribute, value)
Expand Down
8 changes: 4 additions & 4 deletions activemodel/lib/active_model/validations/format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ActiveModel

# == Active Model Format Validator
module Validations
class FormatValidator < EachValidator
class FormatValidator < EachValidator #:nodoc:
def validate_each(record, attribute, value)
if options[:with]
regexp = option_call(record, :with)
Expand Down Expand Up @@ -32,12 +32,12 @@ def option_call(record, name)
def record_error(record, attribute, name, value)
record.errors.add(attribute, :invalid, options.except(name).merge!(:value => value))
end

def regexp_using_multiline_anchors?(regexp)
regexp.source.start_with?("^") ||
(regexp.source.end_with?("$") && !regexp.source.end_with?("\\$"))
end

def check_options_validity(options, name)
option = options[name]
if option && !option.is_a?(Regexp) && !option.respond_to?(:call)
Expand Down Expand Up @@ -110,7 +110,7 @@ module HelperMethods
# if the validation should not occur (e.g. <tt>:unless => :skip_validation</tt>,
# or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>). The
# method, proc or string should return or evaluate to a true or false value.
# * <tt>:strict</tt> - Specifies whether validation should be strict.
# * <tt>:strict</tt> - Specifies whether validation should be strict.
# See <tt>ActiveModel::Validation#validates!</tt> for more information.
# * <tt>:multiline</tt> - Set to true if your regular expression contains
# anchors that match the beginning or end of lines as opposed to the
Expand Down
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/validations/inclusion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module ActiveModel

# == Active Model Inclusion Validator
module Validations
class InclusionValidator < EachValidator
class InclusionValidator < EachValidator #:nodoc:
include Clusivity

def validate_each(record, attribute, value)
Expand Down
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/validations/length.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ActiveModel

# == Active Model Length Validator
module Validations
class LengthValidator < EachValidator
class LengthValidator < EachValidator #:nodoc:
MESSAGES = { :is => :wrong_length, :minimum => :too_short, :maximum => :too_long }.freeze
CHECKS = { :is => :==, :minimum => :>=, :maximum => :<= }.freeze

Expand Down
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/validations/numericality.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ActiveModel

# == Active Model Numericality Validator
module Validations
class NumericalityValidator < EachValidator
class NumericalityValidator < EachValidator #:nodoc:
CHECKS = { :greater_than => :>, :greater_than_or_equal_to => :>=,
:equal_to => :==, :less_than => :<, :less_than_or_equal_to => :<=,
:odd => :odd?, :even => :even?, :other_than => :!= }.freeze
Expand Down
4 changes: 2 additions & 2 deletions activemodel/lib/active_model/validations/presence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module ActiveModel

# == Active Model Presence Validator
module Validations
class PresenceValidator < EachValidator
class PresenceValidator < EachValidator #:nodoc:
def validate(record)
record.errors.add_on_blank(attributes, options)
end
Expand Down Expand Up @@ -40,7 +40,7 @@ module HelperMethods
# if the validation should not occur (e.g. <tt>:unless => :skip_validation</tt>,
# or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>). The method,
# proc or string should return or evaluate to a true or false value.
# * <tt>:strict</tt> - Specifies whether validation should be strict.
# * <tt>:strict</tt> - Specifies whether validation should be strict.
# See <tt>ActiveModel::Validation#validates!</tt> for more information.
def validates_presence_of(*attr_names)
validates_with PresenceValidator, _merge_attributes(attr_names)
Expand Down
4 changes: 2 additions & 2 deletions activemodel/lib/active_model/validations/with.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def _merge_attributes(attr_names)
end
end

class WithValidator < EachValidator
class WithValidator < EachValidator #:nodoc:
def validate_each(record, attr, val)
method_name = options[:with]

Expand Down Expand Up @@ -61,7 +61,7 @@ module ClassMethods
# (e.g. <tt>:unless => :skip_validation</tt>, or
# <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).
# The method, proc or string should return or evaluate to a true or false value.
# * <tt>:strict</tt> - Specifies whether validation should be strict.
# * <tt>:strict</tt> - Specifies whether validation should be strict.
# See <tt>ActiveModel::Validation#validates!</tt> for more information.
#
# If you pass any additional configuration options, they will be passed
Expand Down