Module: Frulo
- Includes:
- HTTParty
- Defined in:
- lib/frulo.rb
Defined Under Namespace
Classes: Plan, Resource, Subscriber
Class Method Summary collapse
Class Method Details
.configure(site_name, token) ⇒ Object
10 11 12 13 14 |
# File 'lib/frulo.rb', line 10 def self.configure(site_name, token) base_uri "http://frulo.co.za/v1/#{site_name}" @site_name = site_name default_params :user_credentials => token end |
.to_xml_params(hash) ⇒ Object
:nodoc:
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/frulo.rb', line 16 def self.to_xml_params(hash) # :nodoc: hash.collect do |key, value| tag = key.to_s.tr('_', '-') result = "<#{tag}>" if value.is_a?(Hash) result << to_xml_params(value) else result << value.to_s end result << "</#{tag}>" result end.join('') end |