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

Returns a new instance of Base.



8
9
10
# File 'lib/vero/api.rb', line 8

def initialize(context)
  self.context = context
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



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

def context
  @context
end

Instance Method Details

#configObject



12
13
14
# File 'lib/vero/api.rb', line 12

def config
  context.config
end

#run_api(api_klass, options) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/vero/api.rb', line 16

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