Replaced most attr_accessor calls by explicit setter methods.
[redact.git] / lib / redact / redact.rb
index 078a63f17737bdd40be66c411f495fbe9c78412b..260f34208c31afa73de7d7a2613406ac43c1b91b 100644 (file)
@@ -1,5 +1,5 @@
 #--
-# $Id: redact.rb 5 2005-03-26 20:23:02Z tilman $
+# $Id: redact.rb 25 2005-04-14 19:42:06Z tilman $
 #
 # Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de)
 #
@@ -57,7 +57,7 @@ class String
 end
 
 module Redact
-       VERSION = "0.0.1"
+       VERSION = "0.1.0"
 
        class RedactError < StandardError; end
 
@@ -230,8 +230,8 @@ module Redact
        end
 
        class Collection
-               attr_reader :name, :id, :data, :min, :max, :parts, :programs
-               attr_accessor :script
+               attr_reader :name, :id, :data, :min, :max, :parts, :programs,
+                           :script
 
                def initialize(name, id)
                        @name = name.to_str.dup.freeze
@@ -247,6 +247,10 @@ module Redact
                        @script = nil
                end
 
+               def script=(v)
+                       @script = v.to_str.dup
+               end
+
                def part(name, type = :invalid) # :yields: part
                        p = @parts[name]
                        if p.nil?