Class: Vero::Api::Base

Inherits:
Object show all
Defined in:
lib/vero/api.rb

Direct Known Subclasses

Events, Users

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Base



6
7
8
# File 'lib/vero/api.rb', line 6

def initialize(context)
  self.context = context
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



4
5
6
# File 'lib/vero/api.rb', line 4

def context
  @context
end

Instance Method Details

#configObject



10
11
12
# File 'lib/vero/api.rb', line 10

def config
  self.context.config
end

#run_api(api_klass, options) ⇒ Object



14
15
16
17
18
19
# File 'lib/vero/api.rb', line 14

def run_api(api_klass, options)
  return if config.disabled
  validate_configured!
  options.merge!(config.request_params)
  Vero::Sender.send(api_klass, config.async, config.domain, options)
end