Class: Totangorb::Tracker
- Inherits:
-
Object
- Object
- Totangorb::Tracker
- Defined in:
- lib/totangorb/tracker.rb
Constant Summary collapse
- BASE_URL =
'http://sdr.totango.com/pixel.gif/?'
Instance Method Summary collapse
-
#initialize(service_id = nil, options = {}) {|_self| ... } ⇒ Tracker
constructor
A new instance of Tracker.
- #track(params = nil) {|params| ... } ⇒ Object
Constructor Details
#initialize(service_id = nil, options = {}) {|_self| ... } ⇒ Tracker
Returns a new instance of Tracker.
13 14 15 16 17 18 19 20 |
# File 'lib/totangorb/tracker.rb', line 13 def initialize(service_id = nil, = {}) raise(::Error, 'You must provide your private API key.') unless service_id @service_id = service_id @debug = .fetch(:debug, false) @logger = .fetch(:logger) { NullLogger.new } yield(self) if block_given? end |
Instance Method Details
#track(params = nil) {|params| ... } ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/totangorb/tracker.rb', line 22 def track(params = nil) params ||= OpenStruct.new yield(params) if block_given? perform_request(params.to_h) end |