class Jabber::Bytestreams::IqSiFileRange

Information for ranged transfers

Public Class Methods

new(offset=nil, length=nil) click to toggle source
Calls superclass method
# File lib/xmpp4r/bytestreams/iq/si.rb, line 174
def initialize(offset=nil, length=nil)
  super()

  self.offset = offset
  self.length = length
end

Public Instance Methods

length() click to toggle source

File length (if not to transfer whole file)

# File lib/xmpp4r/bytestreams/iq/si.rb, line 195
def length
  (attributes['length'] =~ /^\d+$/) ? attributes['length'].to_i : nil
end
length=(o) click to toggle source

Set file length

# File lib/xmpp4r/bytestreams/iq/si.rb, line 201
def length=(o)
  attributes['length'] = (o ? o.to_s : nil)
end
offset() click to toggle source

File offset (for continuing an interrupted transfer)

# File lib/xmpp4r/bytestreams/iq/si.rb, line 183
def offset
  (attributes['offset'] =~ /^\d+$/) ? attributes['offset'].to_i : nil
end
offset=(o) click to toggle source

Set file offset

# File lib/xmpp4r/bytestreams/iq/si.rb, line 189
def offset=(o)
  attributes['offset'] = (o ? o.to_s : nil)
end