kandy_wrapper 0.1.0 → 0.1.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
  SHA1:
3
- metadata.gz: c33b95847731ceafc474ecd3a3a97f5bd5193aa1
4
- data.tar.gz: 4f74e24a5fa48b69fe8e6d608d3055d6244f9707
3
+ metadata.gz: 7d345128c0d8ace7e3a0591f90010d5122c4a443
4
+ data.tar.gz: c89b087955221d0dd34aa3267c590c450c84f0e5
5
5
  SHA512:
6
- metadata.gz: 3a5f955adbcd446f5adcd602acbe62d02ff3b6a32c4673c873b2e494e959adab6edbd297b66dd91194b15f1c751eaf3097ca8e53fa7d570b951661edc451104a
7
- data.tar.gz: eb9f4ca0e9ca55b22a6f7cae91b2e0d45ada61485e2dac66a5451e0399d46639393bf575b5a76dfe3407f4c9a1ea7ad83273d0429cd4dd6184605199dea6a223
6
+ metadata.gz: 7725bc9cae05d83e93a2a470431ddf78a942968e4a578950ff45df5c37b7e636e225d2e0ddbd6711067fdfa526790e89c776929109e153b3c1ac247be5e2a469
7
+ data.tar.gz: f771b0e5aec872c535558d0f11e38b687ccf106ddf993a00720267ad7ef0c76a2e97d36d8e0d748854cf24be5e5f4e8c0d2aef65842710b8c70b6ed34aabb2bd
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # KandyWrapper
2
2
 
3
- 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/kandy_wrapper`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ KandyWrapper is a simple API Wrapper for Kandi.io's REST API. In the future functionality for Kandy.io's JS SDK will be included.
6
4
 
7
5
  ## Installation
8
6
 
@@ -41,19 +39,13 @@ domain = KandyWrapper::Domain.new(account)
41
39
 
42
40
  domain.create_domain(domain_name: "test_domain.com", project_name: "test_project")
43
41
 
44
- # =>
45
- {
46
- "result": {
47
- "domain_api_key": "DAK20cc4a5250e04223b45f026a2d294bc1",
48
- "domain_api_secret": "DAS9e59ca5667ec4b859175c3a780815446"
49
- },
50
- "status": 0,
51
- "message": "success",
52
- "status_description": {
53
- "code": 2000,
54
- "message": "The request completed successfully"
55
- }
56
- }
42
+ domain.domain_name
43
+
44
+ # => "test_domain.com"
45
+
46
+ domain.project_name
47
+
48
+ # => "test_project"
57
49
  ```
58
50
 
59
51
  ## Development
Binary file
@@ -4,7 +4,7 @@ module KandyWrapper
4
4
 
5
5
  base_uri 'https://api.kandy.io/v1.2/'
6
6
 
7
- attr_accessor :domain_name, :project_name
7
+ attr_accessor :domain_name, :project_name, :access_token
8
8
 
9
9
  def initialize(account)
10
10
  @account = account
@@ -14,10 +14,13 @@ module KandyWrapper
14
14
  end
15
15
 
16
16
  def create_domain(domain_name:, project_name:)
17
- self.class.get("/accounts/domains",
18
- query: { key: access_token },
19
- body: { domain_name: domain_name, project_name: project_name }
20
- )
17
+ response = self.class.get("/accounts/domains",
18
+ query: { key: access_token },
19
+ body: { domain_name: domain_name, project_name: project_name }
20
+ )
21
+
22
+ self.domain_name = response["domain_name"]
23
+ self.project_name = response["project_name"]
21
24
  end
22
25
  end
23
26
  end
@@ -1,3 +1,3 @@
1
1
  module KandyWrapper
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kandy_wrapper
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
  - Glenn Espinosa
@@ -125,6 +125,7 @@ files:
125
125
  - Rakefile
126
126
  - bin/console
127
127
  - bin/setup
128
+ - kandy_wrapper-0.1.0.gem
128
129
  - kandy_wrapper.gemspec
129
130
  - lib/kandy_wrapper.rb
130
131
  - lib/kandy_wrapper/account.rb