module LaMetric

Constants

Frame

Public Class Methods

configuration() click to toggle source
# File lib/la_metric.rb, line 6
def self.configuration
  @configuration ||= Configuration.new
end
configure() { |configuration| ... } click to toggle source
# File lib/la_metric.rb, line 10
def self.configure
  yield(configuration)
end
push(frames) click to toggle source
# File lib/la_metric.rb, line 14
def self.push(frames)
  configuration.validate!

  conn = Faraday.new(url: configuration.url)
  conn.post do |req|
    req.headers['Accept'] = 'application/json'
    req.headers['Cache-Control'] = 'no-cache'
    req.headers['X-Access-Token'] = configuration.access_token
    req.body = frames.to_json
  end
end