megam_api 0.59 → 0.60
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/megam/api/version.rb +1 -1
- data/lib/megam/core/discounts_collection.rb +20 -0
- metadata +30 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1a0cdb5d59b8121bacce77444aa19f1f09f5b2b
|
4
|
+
data.tar.gz: 8fd06bd4747a2173d48975a5174616d2514fd912
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29c412146699c468d6e8dad37f87c6e5c660178a15aa27d0a3d265f16af4dbff67f1e531d8859ed9ee11cea48002db6d7842d84f7b4e4cef14de107cded92fb5
|
7
|
+
data.tar.gz: e7454a68624ee2bc14383fc5f567f590c865d6205d668f6585cbd24ec68a78f4fb24fc5338b80851875376224862d8bbf548812b0da654436617667c9178e0a4
|
data/lib/megam/api/version.rb
CHANGED
@@ -100,6 +100,26 @@ module Megam
|
|
100
100
|
end
|
101
101
|
@discounts[res]
|
102
102
|
end
|
103
|
+
|
104
|
+
#THIS RETURNS NIL WHEN A PARTICULAR PROMO TYPE IS NOT PRESENT -
|
105
|
+
#DID NOT DISTURB THE ACTUAL LOOKUP
|
106
|
+
def lookup_p(discounts)
|
107
|
+
lookup_by = nil
|
108
|
+
if discounts.kind_of?(Megam::Discounts)
|
109
|
+
lookup_by = discounts.code
|
110
|
+
elsif discounts.kind_of?(String)
|
111
|
+
lookup_by = discounts
|
112
|
+
else
|
113
|
+
raise ArgumentError, "Must pass a Megam::discounts or String to lookup"
|
114
|
+
end
|
115
|
+
res =@discounts_by_name[lookup_by]
|
116
|
+
unless res
|
117
|
+
return nil
|
118
|
+
end
|
119
|
+
@discounts[res]
|
120
|
+
end
|
121
|
+
|
122
|
+
|
103
123
|
|
104
124
|
# Transform the ruby obj -> to a Hash
|
105
125
|
def to_hash
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: megam_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.60'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajthilak, Kishorekumar Neelamegam, Thomas Alrin, Yeshwanth Kumar, Subash Sethurajan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|
@@ -257,8 +257,34 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
257
257
|
version: '0'
|
258
258
|
requirements: []
|
259
259
|
rubyforge_project:
|
260
|
-
rubygems_version: 2.4.
|
260
|
+
rubygems_version: 2.4.6
|
261
261
|
signing_key:
|
262
262
|
specification_version: 4
|
263
263
|
summary: Ruby Client for the Megam
|
264
|
-
test_files:
|
264
|
+
test_files:
|
265
|
+
- test/test_accounts.rb
|
266
|
+
- test/test_assemblies.rb
|
267
|
+
- test/test_assembly.rb
|
268
|
+
- test/test_availableunits.rb
|
269
|
+
- test/test_balances.rb
|
270
|
+
- test/test_billinghistories.rb
|
271
|
+
- test/test_billings.rb
|
272
|
+
- test/test_cat_requests.rb
|
273
|
+
- test/test_cloudtoolsettings.rb
|
274
|
+
- test/test_components.rb
|
275
|
+
- test/test_credithistories.rb
|
276
|
+
- test/test_csars.rb
|
277
|
+
- test/test_discounts.rb
|
278
|
+
- test/test_domains.rb
|
279
|
+
- test/test_event.rb
|
280
|
+
- test/test_helper.rb
|
281
|
+
- test/test_login.rb
|
282
|
+
- test/test_logs.rb
|
283
|
+
- test/test_marketplaceaddons.rb
|
284
|
+
- test/test_marketplaces.rb
|
285
|
+
- test/test_organizations.rb
|
286
|
+
- test/test_predefclouds.rb
|
287
|
+
- test/test_promos.rb
|
288
|
+
- test/test_requests.rb
|
289
|
+
- test/test_sshkeys.rb
|
290
|
+
- test/test_subscriptions.rb
|