Class: Jabber::Bytestreams::IBBQueueItem

Inherits:
Object
  • Object
show all
Defined in:
lib/vendor/xmpp4r/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.



237
238
239
240
241
242
243
244
245
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/ibb/base.rb', line 237

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.



236
237
238
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/ibb/base.rb', line 236

def seq
  @seq
end

#typeObject (readonly)

Returns the value of attribute type.



236
237
238
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/ibb/base.rb', line 236

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.



252
253
254
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/ibb/base.rb', line 252

def data
  Base64::decode64(@data)
end