class Blather::Stanza::Message::Delay

Public Class Methods

new(stamp = nil, from = nil, description = nil) click to toggle source
Calls superclass method
# File lib/blather/stanza/message.rb, line 394
def self.new(stamp = nil, from = nil, description = nil)
  new_node = super :delay

  case stamp
  when Nokogiri::XML::Node
    new_node.inherit stamp
  when Hash
    new_node.stamp = stamp[:stamp]
    new_node.from = stamp[:from]
    new_node.description = stamp[:description]
  else
    new_node.stamp = stamp
    new_node.from = from
    new_node.description = description
  end
  new_node
end

Public Instance Methods

description() click to toggle source
# File lib/blather/stanza/message.rb, line 421
def description
  content.strip
end
from() click to toggle source
# File lib/blather/stanza/message.rb, line 412
def from
  read_attr :from
end
stamp() click to toggle source
# File lib/blather/stanza/message.rb, line 416
def stamp
  s = read_attr :stamp
  s && Time.parse(s)
end