Class: Jts

Inherits:
Site show all
Defined in:
lib/tRuTag.rb

Instance Attribute Summary

Attributes inherited from Site

#attrib

Instance Method Summary collapse

Methods inherited from Site

#get_uml, #initialize, #required_attribute

Constructor Details

This class inherits a constructor from Site

Instance Method Details

#add_tags(tbin) ⇒ Object



382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/tRuTag.rb', line 382

def add_tags(tbin)
	required_attribute('username')
	required_attribute('pwd')
	
	if !@attrib.fetch('isoffline', FALSE)
		# Make an object to represent the XML-RPC server.
		server = XMLRPC::Client.new( "www.jots.com", "/xmlrpc.cgi")
		
		# Call the remote server and get our result
		result = server.call('jots.getAccountTags', @attrib['username'], @attrib['pwd'])
		
		# Convert the array to a hash
		result.each { |x| tbin[x.downcase] = (tbin.fetch(x, 0) + 1) }
	end
end