summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rbot/core/utils/filters.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/rbot/core/utils/filters.rb b/lib/rbot/core/utils/filters.rb
index 5744b732..fbd20333 100644
--- a/lib/rbot/core/utils/filters.rb
+++ b/lib/rbot/core/utils/filters.rb
@@ -18,8 +18,15 @@ module ::Irc
# converting to String
class DataStream < Hash
- def initialize(hsh={})
- self.replace(hsh)
+ # call-seq: new(text, hash)
+ #
+ # Create a new DataStream with text _text_ and attributes held by _hash_.
+ # Either parameter can be missing; if _text_ is missing, the text can be
+ # be defined in the _hash_ with a :text key.
+ #
+ def initialize(*args)
+ self.replace(args.pop) if Hash === args.last
+ self[:text] = args.first if args.length > 0
end
# Returns the :text key