Module: Collecta::Pubsub

Included in:
Archive, Subscribe
Defined in:
lib/collecta/pubsub.rb

Constant Summary collapse

DATA_NS =
'jabber:x:data'.freeze

Instance Method Summary collapse

Instance Method Details

#apikeyObject



5
6
7
# File 'lib/collecta/pubsub.rb', line 5

def apikey
  self.options.content_from '//ns:field[@var="x-collecta#apikey"]/ns:value', :ns => DATA_NS
end

#apikey=(key) ⇒ Object



9
10
11
# File 'lib/collecta/pubsub.rb', line 9

def apikey=(key)
  self.add_field 'x-collecta#apikey', key
end

#notifyObject



21
22
23
# File 'lib/collecta/pubsub.rb', line 21

def notify
  self.options.find('//ns:field[@var="x-collecta#notify"]/ns:value', :ns => DATA_NS).map { |n| n.content }
end

#notify=(values) ⇒ Object



25
26
27
# File 'lib/collecta/pubsub.rb', line 25

def notify=(values)
  self.add_field 'x-collecta#notify', values
end

#queryObject



13
14
15
# File 'lib/collecta/pubsub.rb', line 13

def query
  self.options.find('//ns:field[@var="x-collecta#query"]/ns:value', :ns => DATA_NS).map { |n| n.content }
end

#query=(values) ⇒ Object



17
18
19
# File 'lib/collecta/pubsub.rb', line 17

def query=(values)
  self.add_field 'x-collecta#query', values
end