lib/eotb.rb in eotb-0.0.1 vs lib/eotb.rb in eotb-0.0.2
- old
+ new
@@ -1,17 +1,22 @@
require 'json'
+require 'net/http'
class Eotb
- def initialize
+ def initialize(api_key, host = '127.0.0.1:3000')
+ @api_key = api_key
+ @host = host
@array = []
end
- def to_json
- JSON.generate(@array)
+ def to_json(array = @array)
+ JSON.generate(array)
end
- def register_event(actor = :user, action = :no_action, subject = {})
+ def register_event(actor, action, subject)
@array << actor << action << subject
+ @array.to_json
+ # @array.clear
end
end
\ No newline at end of file