loops_rails 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be0f5a041a6bc29955f19f4f9f81ecb670233e2a8776772d8e894070eab38a6a
4
- data.tar.gz: a6b3358e15f6b3dcf6db27999205c7ee6066ed08e9034840c20db4d51e106430
3
+ metadata.gz: f4a01b300b7edd07daf94406b06af9fcc49ecca1a8f731240ead0bfa845baed9
4
+ data.tar.gz: 8891a9cce0094da646b82f24e1f9b29a9e1d9d567d7ef2baaad788cd6ceb9443
5
5
  SHA512:
6
- metadata.gz: 87d31d93f2c08cd5305e533b18b5b0c295f40cdf478194e308189e87ea2d45964d41c21a93f75aed853a12e1f32d8c65a83539f1aa56c157b92cb533cc21c51f
7
- data.tar.gz: 005f4aa20127104f6b35070b205a8ace43de454e225e4cbe86117b675abc4db6fcdd9b390fef0447e34cfc2c273d12ef0d3917b28e8fb472469ac7e0e4089c0f
6
+ metadata.gz: 84ec1a3d1406415776686e8cb97edb2dff593f8be3fc8592eb80f40ee838a89c991e15309af14e9ac6f46c44cec347e0f1a4302e8b229cc0adba2302bf632f14
7
+ data.tar.gz: 89474f2371cd1e2ca408e590aced6520a40d30540574a2c9d379df5b1b5b39a74756388b1cbd642e66681e0643c81617ab72ad06876f41c48d53416d925ff065
data/README.md CHANGED
@@ -1,24 +1,33 @@
1
1
  # LoopsRails
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/loops_rails`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ LoopsRails is a Rails client for the [Loops](https://loops.so) API.
6
4
 
7
5
  ## Installation
8
6
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
7
  Install the gem and add to the application's Gemfile by executing:
12
8
 
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
9
+ $ bundle add loops_rails
14
10
 
15
11
  If bundler is not being used to manage dependencies, install the gem by executing:
16
12
 
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
13
+ $ gem install loops_rails
18
14
 
19
15
  ## Usage
20
16
 
21
- TODO: Write usage instructions here
17
+ 1. Sign up for a [Loops](https://loops.so) account.
18
+ 2. Create an API key in your account settings.
19
+ 3. Use the API key to authenticate requests to the API.
20
+
21
+ ```ruby
22
+ client = LoopsRails::Client.new(api_key: "your_api_key")
23
+
24
+ client.api_keys.test
25
+ client.contacts.create(email: "john@example.com")
26
+ client.transactional_emails.send(
27
+ email: "john@example.com",
28
+ transactional_id: "your_transactional_id"
29
+ )
30
+ ```
22
31
 
23
32
  ## Development
24
33
 
@@ -26,9 +35,18 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
26
35
 
27
36
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
37
 
38
+ ## TODO
39
+
40
+ - [X] Add support for the `/api-key` endpoint
41
+ - [X] Add support for the `/contacts` endpoint
42
+ - [X] Add support for the `/transactional` endpoint
43
+ - [ ] Add support for the `/lists` endpoint
44
+ - [ ] Add support for the `/events` endpoint
45
+ - [ ] Add support for the `/customFields` endpoint
46
+
29
47
  ## Contributing
30
48
 
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/loops_rails.
49
+ Bug reports and pull requests are welcome on GitHub at https://github.com/danielfriis/loops_rails.
32
50
 
33
51
  ## License
34
52
 
@@ -1,6 +1,6 @@
1
1
  module LoopsRails
2
- class ApiKey < ApiResource
3
- def test_api_key
2
+ class TestApiKey < ApiResource
3
+ def test
4
4
  response = @conn.get('api-key')
5
5
  parse_response(response)
6
6
  end
@@ -12,8 +12,8 @@ module LoopsRails
12
12
  end
13
13
  end
14
14
 
15
- def api_key
16
- @api_key ||= ApiKey.new(@conn)
15
+ def test_api_key
16
+ TestApiKey.new(@conn).test
17
17
  end
18
18
 
19
19
  def contacts
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LoopsRails
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/loops_rails.rb CHANGED
@@ -6,11 +6,10 @@ require_relative "loops_rails/version"
6
6
  require_relative "loops_rails/client"
7
7
  require_relative "loops_rails/configuration"
8
8
  require_relative "loops_rails/client/api_resource"
9
- require_relative "loops_rails/client/api_key"
9
+ require_relative "loops_rails/client/test_api_key"
10
10
  require_relative "loops_rails/client/contacts"
11
11
  require_relative "loops_rails/client/transactional_emails"
12
12
 
13
13
  module LoopsRails
14
14
  class Error < StandardError; end
15
-
16
15
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loops_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Friis
@@ -37,12 +37,13 @@ files:
37
37
  - Rakefile
38
38
  - lib/loops_rails.rb
39
39
  - lib/loops_rails/client.rb
40
- - lib/loops_rails/client/api_key.rb
41
40
  - lib/loops_rails/client/api_resource.rb
42
41
  - lib/loops_rails/client/contacts.rb
42
+ - lib/loops_rails/client/test_api_key.rb
43
43
  - lib/loops_rails/client/transactional_emails.rb
44
44
  - lib/loops_rails/configuration.rb
45
45
  - lib/loops_rails/version.rb
46
+ - loops_rails-0.1.0.gem
46
47
  - loops_rails.gemspec
47
48
  - sig/loops_rails.rbs
48
49
  homepage: https://github.com/danielfriis/loops_rails