File-transfer meta-information, may appear as <file/> in IqSi
# File lib/xmpp4r/bytestreams/iq/si.rb, line 85 def initialize(fname=nil, size=nil) super() self.fname = fname self.size = size end
Get file date
or nil
# File lib/xmpp4r/bytestreams/iq/si.rb, line 118 def date begin Time.xmlschema(attributes['date']) rescue ArgumentError nil end end
Set file date
or nil
# File lib/xmpp4r/bytestreams/iq/si.rb, line 129 def date=(d) attributes['date'] = (d ? d.xmlschema : nil) end
File description
# File lib/xmpp4r/bytestreams/iq/si.rb, line 148 def description first_element_text('desc') end
Set file description
# File lib/xmpp4r/bytestreams/iq/si.rb, line 154 def description=(s) replace_element_text('desc', s) end
Get filename (attribute 'name')
# File lib/xmpp4r/bytestreams/iq/si.rb, line 93 def fname attributes['name'] end
Set filename (attribute 'name')
# File lib/xmpp4r/bytestreams/iq/si.rb, line 99 def fname=(s) attributes['name'] = s end
Get MD5 hash
# File lib/xmpp4r/bytestreams/iq/si.rb, line 105 def hash attributes['hash'] end
Set MD5 hash
# File lib/xmpp4r/bytestreams/iq/si.rb, line 111 def hash=(s) attributes['hash'] = s end
<range/> child
A file-transfer offer may contain this with no attributes set, indicating the ability to do ranged transfers.
# File lib/xmpp4r/bytestreams/iq/si.rb, line 165 def range first_element('range') end
File size in bytes
# File lib/xmpp4r/bytestreams/iq/si.rb, line 136 def size (attributes['size'] =~ /^\d+$/) ? attributes['size'].to_i : nil end
Set file size
# File lib/xmpp4r/bytestreams/iq/si.rb, line 142 def size=(s) attributes['size'] = s ? s.to_s : nil end