relinkly 1.0.0 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ef98f2ea27c1567b2293b703fefabf90c70cbce7fbaa3dfbad54429539e5dca
4
- data.tar.gz: f9185277790a1e86bfccb3a779aa9b4e07986040d64dde19a49df738cb4a281d
3
+ metadata.gz: 62e19675647abf66a3224c35a5f6bd8f9f091e8364d09bfd31f7302a1a097652
4
+ data.tar.gz: 81604d5824117d10be52b756df585e08187e5613f7d788f9490f201a5bd76a39
5
5
  SHA512:
6
- metadata.gz: 2b149562182bc84a107d8279f5beabf470a9dfc95cc3227d97f1ee4553c6d536dcd43c956d4b148e3b686a387a218d249bad6758f79e57c3a90064fd432f920e
7
- data.tar.gz: 70422410b36a9a0af25558e01413ef0475f4b8ca39d3daa4de18ac90b3fdfabeb9d3856e2898943d3517392f67f306e8fb204ccab503d93c566331296a7ecb63
6
+ metadata.gz: 881108d64d8453895389e51fc4dd2e7892ec3913659e47c88138d0d5f5c36a445557060611e371bc44b69d54ee1bc9875e880f23d5929dc292683be3d2df7520
7
+ data.tar.gz: 56330896dd5aa3b5de153c74fdc8e382ccd9ab8b505094ae0f48a886752f891a46c7af711f8c7fb2a68c5a160af2fcb9168e0b570b3e21cc4f9489c078e8a78d
data/README.md CHANGED
@@ -41,13 +41,13 @@ api.domains # GET /v1/domains
41
41
  api.domain(id) # GET /v1/domains/:id
42
42
  api.domain_count(options) # GET /v1/domains/count
43
43
  api.account # GET /v1/account
44
- api.workspaces # GET /v1/workspaces
44
+ api.workspaces # GET /v1/account/workspaces
45
45
  ```
46
46
 
47
47
  #### Tags
48
48
  ```ruby
49
49
  api.tags # GET /v1/tags
50
- api.tags(id) # GET /v1/tags/:id
50
+ api.tag(id) # GET /v1/tags/:id
51
51
  api.tag_count(options) # GET /v1/tags/count
52
52
  api.new_tag(options) # GET /v1/tags/new
53
53
  api.update_tag(id, options) # POST /v1/tags/:id
@@ -66,16 +66,16 @@ api.delete_link(id, options) # DELETE /v1/links/:id
66
66
  api.tags_link(id, options) # GET /v1/links/:id/tags
67
67
  ```
68
68
 
69
- ### Make a new branded short link
69
+ #### Make a new branded short link
70
70
 
71
71
  ```ruby
72
72
  my_domain = api.domains.first
73
73
  link = api.shorten('https://google.com', domain: my_domain.to_h, title: 'Google', description: 'Google Homepage')
74
74
  ```
75
75
 
76
- ### Workspace workaround
76
+ #### Workspace workaround
77
77
  Please see the applicable methods for options available when making requests. In case of new link creation, default workspace is selected if workspace isn't mentioned explictly.
78
- Please pass the workspace_id in the options as follows in case you want to created branded link to another workspace.
78
+ Please pass the workspace_id in the options as follows in case you want to create branded link to another workspace.
79
79
 
80
80
  ```ruby
81
81
  my_domain = api.domains.first
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'httparty'
4
- require 'pry'
5
4
 
6
5
  module Relinkly
7
6
  class RelinklyError < StandardError; end
@@ -12,26 +11,23 @@ module Relinkly
12
11
  API_VERSION = 'v1'
13
12
  BASE_URL = "https://api.rebrandly.com/#{API_VERSION}"
14
13
 
15
- ###########################################################
16
- # ACCOUNT ENDPOINT
17
- # #########################################################
14
+ # ACCOUNT ENDPOINTS
15
+
18
16
  # GET /v1/account
19
17
  def account
20
18
  Creator.new(relinkly_request(:get, 'account'))
21
19
  end
22
20
 
23
- ###########################################################
24
21
  # WORKSPACES ENDPOINTS
25
- # #########################################################
22
+
26
23
  # GET /v1/account/workspaces
27
24
  def workspaces(options = {})
28
25
  all_workspaces = relinkly_request(:get, 'account/workspaces', options)
29
26
  all_workspaces.map { |workspace| Workspace.new(workspace) }
30
27
  end
31
28
 
32
- ###########################################################
33
- # DOMAINS ENDPOINT
34
- # #########################################################
29
+ # DOMAINS ENDPOINTS
30
+
35
31
  # GET /v1/domains
36
32
  def domains(options = {})
37
33
  all_domains = relinkly_request(:get, 'domains', options)
@@ -48,9 +44,8 @@ module Relinkly
48
44
  relinkly_request(:get, 'domains/count')['count']
49
45
  end
50
46
 
51
- ###########################################################
52
- # TAGS ENDPOINT
53
- # #########################################################
47
+ # TAGS ENDPOINTS
48
+
54
49
  # GET /v1/tags
55
50
  def tags(options = {})
56
51
  all_tags = relinkly_request(:get, 'tags', options)
@@ -83,9 +78,8 @@ module Relinkly
83
78
  Tag.new(relinkly_request(:delete, "tags/#{id}", options))
84
79
  end
85
80
 
86
- ###########################################################
87
- # LINKS ENDPOINT
88
- # #########################################################
81
+ # LINKS ENDPOINTS
82
+
89
83
  # GET /v1/links
90
84
  def links(options = {})
91
85
  all_links = relinkly_request(:get, 'links', options)
@@ -130,7 +124,7 @@ module Relinkly
130
124
  options = Hash[options.map { |k, v| [k.to_s.relinkly_lower_camelize.to_sym, v] }]
131
125
  workspace_id = options[:workspace]
132
126
 
133
- # Passes the Workspace_id into header if the link is to be created into specific workspace
127
+ # Passes the workspace_id into header if the operation requires workspace_id to be included.
134
128
  header_with_workspace = workspace_id.nil? ? headers : headers.merge!('workspace' => workspace_id)
135
129
  http_attrs = { headers: header_with_workspace }
136
130
  case method
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Relinkly
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
@@ -24,6 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "bundler", "~> 2.2.3"
25
25
  spec.add_development_dependency "rake", "~> 13.0.3"
26
26
  spec.add_development_dependency "rspec", "~> 3.10.0"
27
- spec.add_development_dependency "pry", "~> 0.13.1"
28
27
  spec.add_dependency 'httparty', '~> 0.18.1'
29
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relinkly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajan Bhattarai
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-31 00:00:00.000000000 Z
11
+ date: 2021-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.10.0
55
- - !ruby/object:Gem::Dependency
56
- name: pry
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 0.13.1
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 0.13.1
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: httparty
71
57
  requirement: !ruby/object:Gem::Requirement