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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5494e30413da3d4e1b029c852be3889550792c8
4
- data.tar.gz: 00b64d152ae5ec21ed41c3b00b7e43a7951584f0
3
+ metadata.gz: 87bfd991d945eaab9a1b13a8c8b0dd9db3a4f109
4
+ data.tar.gz: 6d0183acbe9adebde9380492515bcb5d2f613282
5
5
  SHA512:
6
- metadata.gz: 2c028c1cd1cb953ba6576fee5180a7087ff84b50ca755052351bf0f504273d8b61fddbfb9683ef72b4c089508a4e5d0c3c12f6632f1a365395d7406b527d7cdf
7
- data.tar.gz: 72640f3f583805b0a04f572909402a69ea2831e55c047abcb997375319c1e3c87de2cf827f9734d4577cf3df5ce7f1567c079661e450354939af444f12b03037
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
- > **Still unstable version and prone to change here and there ;)**
3
+ > **Stable version: Still missing the documentation in here and adding real tests cases :/**
4
4
 
5
5
  ## Installation
6
6
 
@@ -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|
@@ -1,8 +1,7 @@
1
1
  module Colppy
2
2
  module Core
3
3
  class Gateway
4
- attr_reader :mode
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
@@ -1,3 +1,3 @@
1
1
  module Colppy
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.3.1".freeze
3
3
  end
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.0
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-29 00:00:00.000000000 Z
11
+ date: 2016-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday