Class: Xrc::Elements::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/xrc/elements/stream.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Stream

Returns a new instance of Stream.



6
7
8
# File 'lib/xrc/elements/stream.rb', line 6

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/xrc/elements/stream.rb', line 4

def options
  @options
end

Instance Method Details

#to_sObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/xrc/elements/stream.rb', line 10

def to_s
  %W[
    <stream:stream
    xmlns:stream="http://etherx.jabber.org/streams"
    xmlns="jabber:client"
    to="#{options[:domain]}"
    xml:lang="en"
    version="1.0">
  ].join(" ")
end