Class: Jabber::Bytestreams::IBBQueueItem
- Inherits:
-
Object
- Object
- Jabber::Bytestreams::IBBQueueItem
- Defined in:
- lib/xmpp4r/bytestreams/helper/ibb/base.rb
Overview
Represents an item in the internal data queue
Instance Attribute Summary collapse
-
#seq ⇒ Object
readonly
Returns the value of attribute seq.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#data ⇒ Object
Return the Base64-decoded data.
-
#initialize(type, seq = nil, data_text = '') ⇒ IBBQueueItem
constructor
A new instance of IBBQueueItem.
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/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
#seq ⇒ Object (readonly)
Returns the value of attribute seq.
236 237 238 |
# File 'lib/xmpp4r/bytestreams/helper/ibb/base.rb', line 236 def seq @seq end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
236 237 238 |
# File 'lib/xmpp4r/bytestreams/helper/ibb/base.rb', line 236 def type @type end |
Instance Method Details
#data ⇒ Object
Return the Base64-decoded data
There’s no need to catch Exceptions here, as none are thrown.
252 253 254 |
# File 'lib/xmpp4r/bytestreams/helper/ibb/base.rb', line 252 def data Base64::decode64(@data) end |