# class Blather::MUC::Owner::Configure

### Constants

DATA_NAMESPACE

### Public Instance Methods

data() click to toggle source

    # File lib/gxg/net_clients.rb, line 333
    def data
      items = create_data.find('//ns:field', :ns => self.class.registered_ns)
      items.inject({}) do |hash, item|
        key       = item[:var]
        value     = item.find_first('ns:value', :ns => self.class.registered_ns)
        value     = value.content
        hash[key] = value
        hash
      end
    end

data=(data = :default) click to toggle source

    # File lib/gxg/net_clients.rb, line 313
    def data=(data = :default)
      create_data[:type] = 'submit'
      unless data.blank? || data == :default
        raise "Invalid data format" unless data.is_a?(Hash)
        data.each {|key, value|
          create_field = XMPPNode.new('field', self.document)
          create_field[:var] = key

          create_field_value = XMPPNode.new('value', self.document)
          if [TrueClass, FalseClass].include?(value.class)
            value = value ? 1 : 0
          end
          create_field_value.content = value.to_s

          create_field << create_field_value
          create_data  << create_field
        }
      end
    end

### Protected Instance Methods

create_data() click to toggle source

    # File lib/gxg/net_clients.rb, line 345
    def create_data
      unless create_data = query.find_first('ns:x', :ns => DATA_NAMESPACE)
        query << (create_data = XMPPNode.new('x', self.document))
        create_data.namespace = DATA_NAMESPACE
      end
      create_data
    end