lib/eotb.rb in eotb-0.5.7 vs lib/eotb.rb in eotb-0.5.8
- old
+ new
@@ -7,16 +7,20 @@
class Eotb
METHODS = [:to_actor, :to_subject, :to_json, :to_hash, :inspect]
def self.configure(api_key, events = 1, host = '127.0.0.1', port = '3000')
+ @@api_key = api_key
@@uri = URI.parse('http://' + host + ':' + port + '/events/' + api_key)
@@post = Net::HTTP::Post.new(@@uri.path)
@@events = {}
@@counter = 1
events >= 1 ? @@reset = events : @@reset = 1
end
+ def self.api_key
+ @@api_key
+ end
def self.register_event(actor, action, subject = {})
action = { "event#{@@counter}[action]" => action.to_s }
event = (hash_format(actor, :actor)).merge(action).merge(hash_format(subject, :subject))