From 755af497555fde16db86f7e51f6462b0aca79b49 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Fri, 30 Jul 2010 02:30:04 +0200 Subject: edit pass to apply API guideline wrt the use of "# =>" in example code --- activemodel/lib/active_model/errors.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'activemodel/lib/active_model/errors.rb') diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 482b3dac47..bf93126d27 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -83,8 +83,8 @@ module ActiveModel # When passed a symbol or a name of a method, returns an array of errors # for the method. # - # p.errors[:name] #=> ["can not be nil"] - # p.errors['name'] #=> ["can not be nil"] + # p.errors[:name] # => ["can not be nil"] + # p.errors['name'] # => ["can not be nil"] def [](attribute) if errors = get(attribute.to_sym) errors @@ -96,7 +96,7 @@ module ActiveModel # Adds to the supplied attribute the supplied error message. # # p.errors[:name] = "must be set" - # p.errors[:name] #=> ['must be set'] + # p.errors[:name] # => ['must be set'] def []=(attribute, error) self[attribute.to_sym] << error end @@ -124,9 +124,9 @@ module ActiveModel # Returns the number of error messages. # # p.errors.add(:name, "can't be blank") - # p.errors.size #=> 1 + # p.errors.size # => 1 # p.errors.add(:name, "must be specified") - # p.errors.size #=> 2 + # p.errors.size # => 2 def size values.flatten.size end @@ -135,16 +135,16 @@ module ActiveModel # # p.errors.add(:name, "can't be blank") # p.errors.add(:name, "must be specified") - # p.errors.to_a #=> ["name can't be blank", "name must be specified"] + # p.errors.to_a # => ["name can't be blank", "name must be specified"] def to_a full_messages end # Returns the number of error messages. # p.errors.add(:name, "can't be blank") - # p.errors.count #=> 1 + # p.errors.count # => 1 # p.errors.add(:name, "must be specified") - # p.errors.count #=> 2 + # p.errors.count # => 2 def count to_a.size end @@ -158,8 +158,8 @@ module ActiveModel # # p.errors.add(:name, "can't be blank") # p.errors.add(:name, "must be specified") - # p.errors.to_xml #=> Produces: - # + # p.errors.to_xml + # # => # # # # # # name can't be blank -- cgit v1.2.3