sendle-api 0.0.11 → 0.0.12

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: 68b93ccc7a2f1762a621462360bfd3efaa0b9a1e
4
- data.tar.gz: eac48906b5c093d3fe83547bebaa9ddd1c3585c4
3
+ metadata.gz: 939e17d825cb0f844980e6bc3ca323966e16f79b
4
+ data.tar.gz: 97c59b2cfe9d7f602abcb864d96726150d9cf3c9
5
5
  SHA512:
6
- metadata.gz: 6d63dfb209cb35f600b6d3f30a4e2ead269245a9a0681a16ab69fbfeb6e062491313e536b5b48be5b9e296881aa496638801fadf6fe40994cdefa22a2227c861
7
- data.tar.gz: 5ec6cfacd67a5494cda6335786500ca45aa7ba13f0a6a9118e3093283f0e9abf01b39a6685af28904ecd8edd74b191489e11b6da9ab06febc75ad61ac546519a
6
+ metadata.gz: 770c10b0e3cc0bcfd6c1882984d10124460bd85226de85791345a4769a892924ccbf20c87c7817aa91c2ae5e2b21361ae66e6f4e9e1695e61aac2a76be99ce03
7
+ data.tar.gz: 23ee31806fed88dccb02f27427c6bdb9150b2299e83f02d079ac5a07d6744e13ced10b06479987542caa0017cc2f59e153ec3ad3c725c9592b7c30f637423032
data/Changelog.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Sendle::Api Changes
2
2
 
3
+ ## 0.0.12
4
+
5
+ * Wrap constants defined in constants.rb inside module namespaces
6
+ * Added constants for Order status
7
+
3
8
  ## 0.0.11
4
9
 
5
10
  * Initial release!
@@ -19,12 +19,6 @@ module Sendle
19
19
  base.extend(Sendle::Api::Sugars::Create)
20
20
  end
21
21
 
22
- protected
23
-
24
- def http_method
25
- :post
26
- end
27
-
28
22
  end
29
23
  end
30
24
  end
@@ -1,4 +1,21 @@
1
- PLAN_EASY = 'easy'
2
- PLAN_PREMIUM = 'premium'
3
- PLAN_PRO = 'pro'
4
- PLANS = [ PLAN_EASY, PLAN_PREMIUM, PLAN_PRO ]
1
+ module Sendle
2
+ module Api
3
+ PLAN_EASY = 'easy'
4
+ PLAN_PREMIUM = 'premium'
5
+ PLAN_PRO = 'pro'
6
+ PLANS = [ PLAN_EASY, PLAN_PREMIUM, PLAN_PRO ]
7
+
8
+ ORDER_STATUS_PAYMENT = 'Payment'
9
+ ORDER_STATUS_PICKUP = 'Pickup'
10
+ ORDER_STATUS_IN_TRANSIT = 'In Transit'
11
+ ORDER_STATUS_DELIVERED = 'Delivered'
12
+ ORDER_STATUS_CANCELLED = 'Cancelled'
13
+ ORDER_STATUSES = [ ORDER_STATUS_PAYMENT,
14
+ ORDER_STATUS_PICKUP,
15
+ ORDER_STATUS_IN_TRANSIT,
16
+ ORDER_STATUS_DELIVERED,
17
+ ORDER_STATUS_CANCELLED
18
+ ]
19
+ end
20
+ end
21
+
@@ -21,7 +21,7 @@ class Sendle::Api::Quote < Sendle::Api::Resource
21
21
  # Checking for valid plan_name, if passed in
22
22
  if params[:plan_name]
23
23
  plan_name = params[:plan_name]
24
- raise Sendle::Api::Errors::InvalidPlan.new(plan_name) unless PLANS.include?(plan_name)
24
+ raise Sendle::Api::Errors::InvalidPlan.new(plan_name) unless Sendle::Api::PLANS.include?(plan_name)
25
25
  end
26
26
  end
27
27
 
@@ -1,5 +1,5 @@
1
1
  module Sendle
2
2
  module Api
3
- VERSION = "0.0.11"
3
+ VERSION = "0.0.12"
4
4
  end
5
5
  end
@@ -44,7 +44,7 @@ describe Sendle::Api::Quote do
44
44
 
45
45
  context "passing in a plan_name" do
46
46
  it "checks a valid plan name is passed in" do
47
- PLANS.each do |plan|
47
+ Sendle::Api::PLANS.each do |plan|
48
48
  params[:plan_name] = plan
49
49
  expect(RestClient::Request).to receive(:execute).and_return(QUOTE_NO_PLAN_RESPONSE)
50
50
  Sendle::Api::Quote.execute(params)
@@ -64,12 +64,12 @@ describe Sendle::Api::Quote do
64
64
  headers: {
65
65
  accept: :json,
66
66
  content_type: :json,
67
- params: params.merge(plan_name: PLAN_EASY)
67
+ params: params.merge(plan_name: Sendle::Api::PLAN_EASY)
68
68
  }
69
69
  }
70
70
  expect(RestClient::Request).to receive(:execute).with(hash_including(expected_params)).and_return(QUOTE_NO_PLAN_RESPONSE)
71
71
 
72
- Sendle::Api::Quote.execute(params.merge(plan_name: PLAN_EASY))
72
+ Sendle::Api::Quote.execute(params.merge(plan_name: Sendle::Api::PLAN_EASY))
73
73
  end
74
74
  end
75
75
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendle-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bobby Lei