pinch-api 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 +4 -4
- data/README.md +23 -39
- data/lib/pinch/configuration.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3a56ab8e7b4a92cff65468ddc3e83273bf451b0
|
4
|
+
data.tar.gz: c3ee564b18ae9b5f8739520e02772c1d40044df4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f20f99d667ce97943f713d3339a041b6c9d036ba5660812e65943c0e6bd161326797bb6307c0abb4ede58f13a5ca7cdf53b3466f4abdd8bb767a38748f7ea25
|
7
|
+
data.tar.gz: fbcd8238d7550ab1ea64da15b021e58334a8e6ec05d0c53012b7b83b84b0547ea450a7a10f1b628bd5ad8dd8f7bf32d94acc899d6fbc1c248f06b1c30b95df1e
|
data/README.md
CHANGED
@@ -1,48 +1,32 @@
|
|
1
1
|
Pinch
|
2
2
|
=================
|
3
|
-
This API SDK was automatically generated by APIMATIC v2.0
|
4
3
|
|
5
|
-
|
6
|
-
=================
|
7
|
-
The generated code might need to be configured with your API credentials. To do that,
|
8
|
-
open the file "configuration.rb" and edit it's contents.
|
9
|
-
|
10
|
-
Alternatively, you can modify the Configuration parameters at run-time through the following
|
11
|
-
```
|
12
|
-
Pinch::Configuration.your_paramater=YOUR_VALUE
|
13
|
-
```
|
4
|
+
## Installation
|
14
5
|
|
15
|
-
|
16
|
-
|
17
|
-
The generated code uses a Ruby gem namely 'unirest'. The reference to this gem is
|
18
|
-
already added in the gemspec. Therefore, you will need internet access to resolve
|
19
|
-
this dependency.
|
6
|
+
To install this gem, simply type :
|
7
|
+
`gem install pinch`
|
20
8
|
|
21
|
-
|
22
|
-
|
23
|
-
The generated code can be used to build gem, which can then be distributed online.
|
24
|
-
Otherwise, you can include the generated code in your project to use directly.
|
9
|
+
You can also add it to a gemfile :
|
10
|
+
`gem 'pinch'`
|
25
11
|
|
26
|
-
|
12
|
+
Finally, if you wish to use the head version, you can specify the github master branch :
|
13
|
+
`gem pinch, github: 'Inchdev/pinch-ruby'`
|
27
14
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
3. In your Gemfile add this line
|
39
|
-
```
|
40
|
-
gem 'pinch', '~> 1.0'
|
41
|
-
```
|
15
|
+
## Configuration
|
16
|
+
There is 2 different ways of authenticating yourself, either from an initializer file :
|
17
|
+
```ruby
|
18
|
+
# config/initializers/pinch.rb
|
19
|
+
require 'pinch'
|
20
|
+
Pinch::Configuration.x_api_token = 'MY_API_KEY'
|
21
|
+
# or the recommended way
|
22
|
+
Pinch::Configuration.x_api_token = ENV['PINCH_API_KEY']
|
23
|
+
```
|
42
24
|
|
43
|
-
|
25
|
+
Or directly before you want to perform a query :
|
26
|
+
```ruby
|
27
|
+
require 'pinch'
|
28
|
+
pinch = Pinch::PinchClient.new(x_api_token: "MY_API_KEY", x_api_email: "myemail@example.com")
|
29
|
+
```
|
44
30
|
|
45
|
-
|
46
|
-
|
47
|
-
ctl.list params
|
48
|
-
```
|
31
|
+
## Usage
|
32
|
+
For further documentation, please refer to [the documentation website](http://doc-company.inchbase.com/?ruby)
|
data/lib/pinch/configuration.rb
CHANGED
@@ -6,10 +6,10 @@ module Pinch
|
|
6
6
|
@base_uri = 'https://api-company.inchbase.com/api/v1'
|
7
7
|
|
8
8
|
# Your api key
|
9
|
-
@x_api_token =
|
9
|
+
@x_api_token = nil
|
10
10
|
|
11
11
|
# Your registered email
|
12
|
-
@x_api_email =
|
12
|
+
@x_api_email = nil
|
13
13
|
|
14
14
|
# create the getters and setters
|
15
15
|
class << self
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pinch-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Inchdev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-05-
|
12
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: unirest
|