Class: Jabber::Bytestreams::IBBQueueItem

Inherits:
Object
  • Object
show all
Defined in:
lib/xmpp4r/bytestreams/helper/ibb/base.rb

Overview

Represents an item in the internal data queue

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, seq = nil, data_text = '') ⇒ IBBQueueItem

Returns a new instance of IBBQueueItem


240
241
242
243
244
245
246
247
248
# File 'lib/xmpp4r/bytestreams/helper/ibb/base.rb', line 240

def initialize(type, seq=nil, data_text='')
  unless [:data, :close].include? type
    raise "Unknown IBBQueueItem type: #{type}"
  end

  @type = type
  @seq = seq
  @data = data_text
end

Instance Attribute Details

#seqObject (readonly)

Returns the value of attribute seq


239
240
241
# File 'lib/xmpp4r/bytestreams/helper/ibb/base.rb', line 239

def seq
  @seq
end

#typeObject (readonly)

Returns the value of attribute type


239
240
241
# File 'lib/xmpp4r/bytestreams/helper/ibb/base.rb', line 239

def type
  @type
end

Instance Method Details

#dataObject

Return the Base64-decoded data

There's no need to catch Exceptions here, as none are thrown.


255
256
257
# File 'lib/xmpp4r/bytestreams/helper/ibb/base.rb', line 255

def data
  Base64::decode64(@data)
end