colppy 0.3.0 → 0.3.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 +1 -1
- data/lib/colppy/client.rb +2 -0
- data/lib/colppy/core/gateway.rb +9 -10
- data/lib/colppy/version.rb +1 -1
- 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: 87bfd991d945eaab9a1b13a8c8b0dd9db3a4f109
|
4
|
+
data.tar.gz: 6d0183acbe9adebde9380492515bcb5d2f613282
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3437be3ea7f1b576ffc047cd7433b14f5c1eac6e899fbae7feb16f0087cbe3f529d526039b9afcd412cd7ef07b997450525b8604bba72f38636ff009cde20160
|
7
|
+
data.tar.gz: 71b592f8eb709260fd714bac5ac0fff4b54db64de4917da284076c23d02281eebd5cf2c290ddad50510a9775513a01327849ea143a11c9ec44d65222f9990074
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Colppy [![Build Status](https://travis-ci.org/goodpeople/colppy.svg?branch=master)](https://travis-ci.org/goodpeople/colppy)
|
2
2
|
|
3
|
-
> **
|
3
|
+
> **Stable version: Still missing the documentation in here and adding real tests cases :/**
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
data/lib/colppy/client.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module Colppy
|
2
2
|
class Client
|
3
|
+
extend Forwardable
|
3
4
|
include Digest
|
4
5
|
SERVICES_MANIFEST = Core::SERVICES.freeze
|
5
6
|
|
@@ -14,6 +15,7 @@ module Colppy
|
|
14
15
|
sign_in
|
15
16
|
end
|
16
17
|
end
|
18
|
+
def_delegators :@gateway, :live!, :live?, :sandbox!, :sandbox?
|
17
19
|
|
18
20
|
def inspect
|
19
21
|
formatted_attrs = attr_inspect.map do |attr|
|
data/lib/colppy/core/gateway.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
module Colppy
|
2
2
|
module Core
|
3
3
|
class Gateway
|
4
|
-
|
5
|
-
|
4
|
+
MODES = %w(live sandbox).freeze
|
6
5
|
MIME_JSON = "application/json".freeze
|
7
6
|
SANDBOX_API_URL = "http://staging.colppy.com".freeze
|
8
7
|
PRODUCTION_API_URL = "https://login.colppy.com".freeze
|
@@ -11,19 +10,19 @@ module Colppy
|
|
11
10
|
def initialize(mode = "sandbox")
|
12
11
|
@mode = mode
|
13
12
|
end
|
13
|
+
MODES.each do |mode_name|
|
14
|
+
define_method("#{mode_name}!") do
|
15
|
+
@mode = mode_name
|
16
|
+
end
|
17
|
+
define_method("#{mode_name}?") do
|
18
|
+
@mode == mode_name
|
19
|
+
end
|
20
|
+
end
|
14
21
|
|
15
22
|
def call(payload = {})
|
16
23
|
make_request(payload)
|
17
24
|
end
|
18
25
|
|
19
|
-
def sandbox
|
20
|
-
@mode = "sandbox"
|
21
|
-
end
|
22
|
-
|
23
|
-
def sandbox?
|
24
|
-
@mode == "sandbox"
|
25
|
-
end
|
26
|
-
|
27
26
|
private
|
28
27
|
|
29
28
|
def headers
|
data/lib/colppy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: colppy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agustin Cavilliotti
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|