lib/blather/stanza/message.rb in blather-0.2 vs lib/blather/stanza/message.rb in blather-0.2.1
- old
+ new
@@ -6,15 +6,14 @@
class Message < Stanza
VALID_TYPES = [:chat, :error, :groupchat, :headline, :normal]
register :message
- def self.new(to = nil, body = nil, type = :chat)
- elem = super()
- elem.to = to
- elem.type = type
- elem.body = body
- elem
+ def initialize(to = nil, body = nil, type = :chat)
+ super()
+ self.to = to
+ self.type = type
+ self.body = body
end
VALID_TYPES.each do |valid_type|
define_method("#{valid_type}?") { self.type == valid_type }
end
\ No newline at end of file