Class: Xrc::Elements::Bind

Inherits:
REXML::Element
  • Object
show all
Defined in:
lib/xrc/elements/bind.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Bind

Returns a new instance of Bind.



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/xrc/elements/bind.rb', line 4

def initialize(options = {})
  super("iq")
  bind = REXML::Element.new("bind")
  bind.add_namespace(Namespaces::BIND)
  if options[:resource]
    resource = REXML::Element.new("resource")
    resource.text = options[:resource]
    bind.add(resource)
  end
  add_attributes("type" => "set")
  add(bind)
end