lib/createsend.rb in createsend-1.0.4 vs lib/createsend.rb in createsend-1.1.0

- old
+ new

@@ -11,10 +11,12 @@ require 'createsend/campaign' require 'createsend/list' require 'createsend/segment' require 'createsend/subscriber' require 'createsend/template' +require 'createsend/person' +require 'createsend/administrator' module CreateSend # Just allows callers to do CreateSend.api_key "..." rather than CreateSend::CreateSend.api_key "..." etc class << self @@ -107,9 +109,26 @@ # Gets valid timezones. def timezones response = CreateSend.get('/timezones.json') response.parsed_response + end + + # Gets the administrators + def administrators + response = CreateSend.get('/admins.json') + response.map{|item| Hashie::Mash.new(item)} + end + + def get_primary_contact + response = CreateSend.get('/primarycontact.json') + Hashie::Mash.new(response) + end + + def set_primary_contact(email) + options = { :query => { :email => email } } + response = CreateSend.put("/primarycontact.json", options) + Hashie::Mash.new(response) end def self.get(*args); handle_response super end def self.post(*args); handle_response super end def self.put(*args); handle_response super end \ No newline at end of file