btfy_client 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/btfy_client.rb +2 -1
- data/lib/btfy_client/models/link.rb +13 -0
- data/lib/btfy_client/responses/create_link_response.rb +11 -0
- data/lib/btfy_client/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9e89f1c497ef21deb7f1be89fc82355581dbaaf7e00cbe8eb1a0f52359d7843
|
4
|
+
data.tar.gz: 99dd4569b5cc2cd0eea5810c499a77b800529b02a70279d1e1bad8009e20d68c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b24863e2fed5112b06d823f8c6173c504370d32a8779d33875d4619655ee486cd278a59450ea4a71cb625635f99b273367eb22c98bdaba72cb01342e1416ca6
|
7
|
+
data.tar.gz: 524e33c7476134edd5e8e402ddbd32bb033745d0444e2fb773993c398856f71b050860d3d591a03b3c203f396091df46002f795eef661e29ca5e2f25b57bfff7
|
data/CHANGELOG.md
CHANGED
@@ -5,4 +5,8 @@ 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
7
|
## [Unreleased]
|
8
|
+
- `create_link` also returns a `BtfyClient::Link` class
|
9
|
+
|
10
|
+
## [0.1.0] - 2020-09-06
|
11
|
+
### Added
|
8
12
|
- initial endpoint `create_link`
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -32,7 +32,7 @@ response.body["link"]["redirect_url"] # shortened link
|
|
32
32
|
|
33
33
|
## Development
|
34
34
|
|
35
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `
|
35
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rspec spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
36
36
|
|
37
37
|
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
38
38
|
|
data/lib/btfy_client.rb
CHANGED
@@ -4,13 +4,14 @@ require "api_client_base"
|
|
4
4
|
require "btfy_client/version"
|
5
5
|
require "btfy_client/client"
|
6
6
|
|
7
|
+
require "btfy_client/models/link"
|
7
8
|
require "btfy_client/requests/create_link_request"
|
8
9
|
require "btfy_client/responses/create_link_response"
|
9
10
|
|
10
11
|
BTFY_CLIENT_DIR = Pathname.new(File.dirname(__FILE__)).
|
11
12
|
join("btfy_client")
|
12
13
|
|
13
|
-
%w(requests responses).each do |dir|
|
14
|
+
%w(models requests responses).each do |dir|
|
14
15
|
Dir[BTFY_CLIENT_DIR.join(dir, "*.rb")].each { |f| require f }
|
15
16
|
end
|
16
17
|
|
@@ -4,6 +4,7 @@ module BtfyClient
|
|
4
4
|
include APIClientBase::Response.module
|
5
5
|
|
6
6
|
attribute :body, Object, lazy: true, default: :default_body
|
7
|
+
attribute :link, BtfyClient::Link, default: :default_link
|
7
8
|
|
8
9
|
private
|
9
10
|
|
@@ -11,5 +12,15 @@ module BtfyClient
|
|
11
12
|
raw_response.body
|
12
13
|
end
|
13
14
|
|
15
|
+
def default_link
|
16
|
+
args = {}
|
17
|
+
|
18
|
+
JSON.parse(body).each do |key, value|
|
19
|
+
args[key] = value
|
20
|
+
end
|
21
|
+
|
22
|
+
Link.new(args["link"])
|
23
|
+
end
|
24
|
+
|
14
25
|
end
|
15
26
|
end
|
data/lib/btfy_client/version.rb
CHANGED
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Chavez
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- btfy_client.gemspec
|
103
103
|
- lib/btfy_client.rb
|
104
104
|
- lib/btfy_client/client.rb
|
105
|
+
- lib/btfy_client/models/link.rb
|
105
106
|
- lib/btfy_client/requests/create_link_request.rb
|
106
107
|
- lib/btfy_client/responses/create_link_response.rb
|
107
108
|
- lib/btfy_client/version.rb
|