From: Tilman Sauerbeck Date: Sun, 24 Apr 2005 09:18:07 +0000 (+0000) Subject: Added Relation#set_to. X-Git-Tag: redact-0.1.1~4 X-Git-Url: http://git.code-monkey.de/?p=redact.git;a=commitdiff_plain;h=2bc0b0dc0a9bef0d35883f668e70c951dcb61562 Added Relation#set_to. --- diff --git a/ChangeLog b/ChangeLog index 104a9a0..d88457f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,10 @@ -- -$Id: ChangeLog 31 2005-04-23 22:54:01Z tilman $ +$Id: ChangeLog 32 2005-04-24 09:18:07Z tilman $ ++ 2005-04-24 Tilman Sauerbeck (tilman at code-monkey de) * lib/redact/redact.rb: Fixed exception message + * lib/redact/part.rb: Added Relation#set_to 2005-04-23 Tilman Sauerbeck (tilman at code-monkey de) * lib/redact/app.rb: Comment fix diff --git a/lib/redact/part.rb b/lib/redact/part.rb index 974a6be..706761a 100644 --- a/lib/redact/part.rb +++ b/lib/redact/part.rb @@ -1,5 +1,5 @@ #-- -# $Id: part.rb 29 2005-04-16 15:59:07Z tilman $ +# $Id: part.rb 32 2005-04-24 09:18:07Z tilman $ # # Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de) # @@ -216,7 +216,12 @@ module Redact end def to=(part) - @to_id = [].fill(part.nil? ? -1 : part.id, 0..1) + self.set_to(part) + end + + def set_to(part_x, part_y = part_x) + @to_id = [part_x.nil? ? -1 : part_x.id, + part_y.nil? ? -1 : part_y.id] end end