Class: Irc::Bot::DataStream
Overview
The DataStream class. A DataStream is just a Hash. The :text key has a special meaning because it’s the value that will be used when converting to String
Instance Method Summary collapse
-
#initialize(*args) ⇒ DataStream
constructor
call-seq: new(text, hash).
-
#to_s ⇒ Object
Returns the :text key.
Constructor Details
#initialize(*args) ⇒ DataStream
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.
25 26 27 28 |
# File 'lib/rbot/core/utils/filters.rb', line 25 def initialize(*args) self.replace(args.pop) if Hash === args.last self[:text] = args.first if args.length > 0 end |
Instance Method Details
#to_s ⇒ Object
Returns the :text key
31 32 33 |
# File 'lib/rbot/core/utils/filters.rb', line 31 def to_s return self[:text] end |