kindly-rb 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/kindly.rb +35 -0
  3. metadata +58 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 179e781eee4afe35c14e0681fbdbdfbb8420a6ca
4
+ data.tar.gz: 40e2c5b7800f33ba30221a45e79cd0c48252f3b0
5
+ SHA512:
6
+ metadata.gz: 2e09f10da42264690bd58f09fd940195f4bb807913f470eeafa920ca9148c2f19db6a86e6a579ca3981a90700e000e62d3a81effdb481c2a90b2e48e45f8db18
7
+ data.tar.gz: 3459b569bf1565b8e5123b9a86fb5c0913d8b99fba7561295dc64af4c9f2be3da886a6defa479682f71273e145d74f97b6e7ce4c85586be0a2e2d708bc795fe1
data/lib/kindly.rb ADDED
@@ -0,0 +1,35 @@
1
+ require "requests"
2
+
3
+ module Kindly
4
+ class << self
5
+ attr_accessor :configuration
6
+ end
7
+
8
+ def self.configure
9
+ self.configuration ||= Configuration.new
10
+ yield(configuration)
11
+ end
12
+
13
+ class Configuration
14
+ attr_accessor :api_key
15
+ attr_accessor :api_host
16
+
17
+ def initialize
18
+ @api_host = "https://bot.kindly.ai"
19
+ @api_key = nil
20
+ end
21
+ end
22
+
23
+ def self.send(user_id: nil, message: nil, exchange_id: nil)
24
+ Requests.request(
25
+ "POST",
26
+ self.configuration.api_host + "/api/v1/send",
27
+ data: {
28
+ api_key: self.configuration.api_key,
29
+ user_id: user_id,
30
+ messeage: message,
31
+ exchange_id: exchange_id,
32
+ }.to_json
33
+ )
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kindly-rb
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Gunnar Fornes
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-08-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: requests
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: A small wrapper for Ruby-applications to integrate with Kindly
28
+ email: gunnar@convertelligence.no
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/kindly.rb
34
+ homepage: https://docs.kindly.ai
35
+ licenses:
36
+ - ISC
37
+ metadata: {}
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubyforge_project:
54
+ rubygems_version: 2.5.1
55
+ signing_key:
56
+ specification_version: 4
57
+ summary: Ruby library for Kindly
58
+ test_files: []