cloverrb 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c889c66f8d40db2d68185cf560e8cc2b3b68ac1
4
- data.tar.gz: 3382c170ac5f1d3da11f4491babfb14a31f00c84
3
+ metadata.gz: 8eafda95615d82c13ac0ae8ed1ae52e236370128
4
+ data.tar.gz: c97956f240b0d7a65a6149951eefd7304d6f8801
5
5
  SHA512:
6
- metadata.gz: 69f8e243149891d700e2324597442635674d1d2490a9b04ce761d98bde0c8d165851d4b240fe6d9313e92ea315a62f320a70bfeedb7da3641c7134d45e6ef040
7
- data.tar.gz: 733b8b291c0ef0bdecaf95ae4f018809ab2b0001919361e07731c1604dfa0bd59a4b958e0f71cdbe0c80976bb93b2b605e9638905510de7529c6939e9ea53887
6
+ metadata.gz: 2bf48950ef656d18a9cd3155a62cbdd1847d28847b83fc1642d0004ffd8ca803aae875fcee95d88de1b07758b882669a03b370a4432293d147e9912fd952c0ff
7
+ data.tar.gz: 234b6da008c169adf7f8d5f66b41a10f6b95cd5062395dddf974d728817dc5b30d5f30cbc68bb43fcf75a9876fddc7457f8e6be5d31a12da4277e49858fe082d
data/README.md CHANGED
@@ -40,6 +40,12 @@ Or install it yourself as:
40
40
  employees_client.all(merchant_id)
41
41
  ```
42
42
 
43
+ > Get a single employee
44
+ ```ruby
45
+ employees_client = Cloverrb::Employee(token, merchant_id)
46
+ employees_client.find(employee_id)
47
+ ```
48
+
43
49
  ### Order
44
50
  > Get a list of orders of a specific merchant
45
51
  ```ruby
@@ -1,15 +1,15 @@
1
1
  module Cloverrb
2
2
  class Client
3
- @base_url = "https://api.clover.com/v3"
3
+ BASE_URL = "https://api.clover.com/v3"
4
4
  AUTH_URL = "https://clover.com/oauth/token"
5
5
 
6
6
  def get(token, path)
7
- HTTParty.get(@base_url + path, headers: build_headers(token)).parsed_response
7
+ HTTParty.get(BASE_URL + path, headers: build_headers(token)).parsed_response
8
8
  end
9
9
 
10
10
  def post(token, path, body)
11
11
  HTTParty.post(
12
- @base_url + path,
12
+ BASE_URL + path,
13
13
  headers: build_headers(token),
14
14
  query: body
15
15
  ).parsed_response
@@ -17,7 +17,7 @@ module Cloverrb
17
17
 
18
18
  def put(token, path, body)
19
19
  HTTParty.put(
20
- @base_url + path,
20
+ BASE_URL + path,
21
21
  headers: build_headers(token),
22
22
  query: body
23
23
  ).parsed_response
@@ -10,5 +10,10 @@ module Cloverrb
10
10
  url += "?filter=role=#{role}" if role
11
11
  get(@token, url)
12
12
  end
13
+
14
+ def find(employee_id)
15
+ url = "/merchants/#{@merchant_code}/employees/#{employee_id}"
16
+ get(@token, url)
17
+ end
13
18
  end
14
19
  end
@@ -1,10 +1,9 @@
1
1
  module Cloverrb
2
2
  class LineItem < Client
3
- def initialize(token, order, merchant, sandbox=false)
3
+ def initialize(token, order, merchant)
4
4
  @token = token
5
5
  @order = order
6
6
  @merchant = merchant
7
- @base_url = "https://apisandbox.dev.clover.com/v3" if sandbox
8
7
  end
9
8
 
10
9
  def all
@@ -1,8 +1,7 @@
1
1
  module Cloverrb
2
2
  class Order < Client
3
- def initialize(token, sandbox=false)
3
+ def initialize(token)
4
4
  @token = token
5
- @base_url = "https://apisandbox.dev.clover.com/v3" if sandbox
6
5
  end
7
6
 
8
7
  def all(merchant_id, options = {})
@@ -1,3 +1,3 @@
1
1
  module Cloverrb
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloverrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Jon Villalobos
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-20 00:00:00.000000000 Z
11
+ date: 2017-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler