btfy_client 0.3.0 → 0.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a83eeaa6931feb610061e61d6925263e9ea51c10b7fdf7c4e1b3a18f633bd15d
4
- data.tar.gz: ef7eb9712e97bf5f072e5edf51f260def9890f8adab7ccaf9104ed51948f8561
3
+ metadata.gz: 7df6f1b5e131c3b0a7d126ecb564b96ca94261beb6eb96e1d44947b2bf170ed5
4
+ data.tar.gz: fe20ac93e789a28e037c484f1823ce2218fe22519704bfc33cef09911a58ecb7
5
5
  SHA512:
6
- metadata.gz: 6ee719ff3a178a7461086ed61d85ba70437ff10de78d1ffd713fdca49664b1cc8db570f0a61e2e32902b312b3bb317f620987c27a301c2baa700896eb6370e4f
7
- data.tar.gz: 54ae516dcb64ac5df0587741ac9b0091bde992202162f7ad3ff381a67d6cea11a3467ac4314608d3427f5e7a0ead5f3bb6f9700c6422ff8ca8b552db60099c8b
6
+ metadata.gz: 44bd380a62a15522c9a08b83aef32e5cfc592fb5bab981b433f9a09f9a51baf21e3f8011a9d5d6e6f5cbdaa0d7d49aafb3fad828330c405c79429498b7aff593
7
+ data.tar.gz: 35a7dab01d17a7da404c051cbd3cee5c6dd2404b78b92e0771e71c0f6f1a341404b6bcc6aad7eeb9e96d5365e18379a4aa8c8854f9efc5cbbc97cc13f8a9c17e
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.4.0] - 2020-09-06
8
+ ### Changed
9
+ - add `BaseRequest` for reuse
10
+
7
11
  ## [0.3.0] - 2020-09-06
8
12
  ### Added
9
13
  - add `name` and `slug` request params
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- btfy_client (0.3.0)
4
+ btfy_client (0.4.0)
5
5
  api_client_base
6
6
  typhoeus
7
7
 
@@ -5,6 +5,7 @@ require "btfy_client/version"
5
5
  require "btfy_client/client"
6
6
 
7
7
  require "btfy_client/models/link"
8
+ require "btfy_client/requests/base_request"
8
9
  require "btfy_client/requests/create_link_request"
9
10
  require "btfy_client/responses/create_link_response"
10
11
 
@@ -0,0 +1,17 @@
1
+ module BtfyClient
2
+ class BaseRequest
3
+
4
+ include APIClientBase::Request
5
+
6
+ attribute :host, String
7
+ attribute :api_token, String
8
+
9
+ def headers
10
+ {
11
+ "Content-Type" => "application/json",
12
+ "Authorization" => "Bearer #{api_token}",
13
+ }
14
+ end
15
+
16
+ end
17
+ end
@@ -1,21 +1,12 @@
1
1
  module BtfyClient
2
- class CreateLinkRequest
2
+ class CreateLinkRequest < BaseRequest
3
3
 
4
4
  include APIClientBase::Request
5
5
 
6
- attribute :host, String
7
- attribute :api_token, String
8
6
  attribute :destination_url, String
9
7
  attribute :name, String
10
8
  attribute :slug, String
11
9
 
12
- def headers
13
- {
14
- "Content-Type" => "application/json",
15
- "Authorization" => "Bearer #{api_token}",
16
- }
17
- end
18
-
19
10
  def body
20
11
  body = { destination_url: destination_url }
21
12
 
@@ -1,3 +1,3 @@
1
1
  module BtfyClient
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: btfy_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Chavez
@@ -103,6 +103,7 @@ files:
103
103
  - lib/btfy_client.rb
104
104
  - lib/btfy_client/client.rb
105
105
  - lib/btfy_client/models/link.rb
106
+ - lib/btfy_client/requests/base_request.rb
106
107
  - lib/btfy_client/requests/create_link_request.rb
107
108
  - lib/btfy_client/responses/create_link_response.rb
108
109
  - lib/btfy_client/version.rb