From 04b09aeb9b490ef5f1dcf2e4aa04f7d5cc766752 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sat, 2 Apr 2005 22:15:29 +0000 Subject: [PATCH] Some cosmetic changes. --- ChangeLog | 3 ++- lib/redact/part.rb | 14 ++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53c95dd..f93fc2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,11 @@ -- -$Id: ChangeLog 19 2005-04-02 22:05:24Z tilman $ +$Id: ChangeLog 20 2005-04-02 22:15:29Z tilman $ ++ 2005-04-03 Tilman Sauerbeck (tilman at code-monkey de) * lib/redact/part.rb: Made 'text_class' and 'color_class' parameters writable + * lib/redact/part.rb: Some cosmetic changes 2005-04-02 Tilman Sauerbeck (tilman at code-monkey de) * lib/redact/part.rb: Made 'step' and 'aspect' parameters diff --git a/lib/redact/part.rb b/lib/redact/part.rb index 4d6cf9f..b1b9978 100644 --- a/lib/redact/part.rb +++ b/lib/redact/part.rb @@ -1,5 +1,5 @@ #-- -# $Id: part.rb 19 2005-04-02 22:05:24Z tilman $ +# $Id: part.rb 20 2005-04-02 22:15:29Z tilman $ # # Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de) # @@ -58,12 +58,10 @@ module Redact end def clip=(part) - if self == part + if part == self raise(ArgumentError, "cannot clip part to itself") - elsif part.nil? - @clip = nil - elsif part.collection != @collection - raise(ArgumentError, "parts' collections not identical") + elsif !part.nil? && part.collection != @collection + raise(ArgumentError, "items not in the same collection") else @clip = part end @@ -178,10 +176,10 @@ module Redact end def confine=(part) - if part == self + if part == @part raise(ArgumentError, "cannot confine part to itself") elsif !part.nil? && part.collection != @part.collection - raise(ArgumentError, "parts' collections not identical") + raise(ArgumentError, "items not in the same collection") else @confine = part end -- 2.30.2