Class: EverylogWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/everylog_wrapper.rb,
lib/everylog_wrapper/version.rb

Constant Summary collapse

VERSION =
"0.1.2"

Class Method Summary collapse

Class Method Details

.send_notification(project_id:, title:, summary:, body:, tags: [], link: "", push: false) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/everylog_wrapper.rb', line 9

def self.send_notification(project_id:, title:, summary:, body:, tags: [], link: "", push: false)
  api_key = ENV["EVERYLOG_KEY"]
  everylog_url = "https://api.everylog.io/api/v1/log-entries"
  body = {
    project_id: project_id,
    title: title,
    summary: summary,
    body: body,
    tags: tags,
    link: link,
    push: push
  }
  HTTParty.post(everylog_url,
                {
                  body: body.to_json,
                  headers: {
                    "Content-Type": "application/json",
                    "Authorization": "Bearer #{api_key}"
                  }
                })
end