module ActionKitApi
This is the connection information for the ActionKit API which is used throughout the rest of the Gem (a connection being required for … well every operation … this is a remote API gem :)
Constants
- VERSION
Public Class Methods
act(page, user, args = {})
click to toggle source
Takes a page object and a user object and a hash of any additional attributes and records the action. Will return a Action
object with status information and unique identifiers
# File lib/action_kit_api.rb, line 28 def self.act(page, user, args = {}) return false unless page.valid? and user.valid? # Ensure we have an ActionKit ID before performing the action user.save if user.akid.nil? # Include the supplied arguments overiding akid and page name if they # were supplied with those in the page and user act_attrs = args.update({ "page" => page.name, "akid" => user.akid, }) self.raw_act(act_attrs) end
connect(username, password, hostname)
click to toggle source
Takes username, password, and hostname. This is simply a wrapper to ActionKitAPi::Connection.connect to make the gem a bit easier to use
# File lib/action_kit_api.rb, line 52 def self.connect(username, password, hostname) @@connection = ActionKitApi::Connection.new(username, password, hostname) end
connection()
click to toggle source
# File lib/action_kit_api.rb, line 56 def self.connection @@connection end
raw_act(*args)
click to toggle source
# File lib/action_kit_api.rb, line 44 def self.raw_act(*args) response = @@connection.call('act', *args) ActionKitApi::Action.new(response) end