alphaSDK 0.2.0 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +6 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +34 -0
- data/LICENSE.txt +21 -0
- data/README.md +44 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/gameball.gemspec +29 -0
- data/lib/gameball.rb +19 -20
- data/lib/gameball/exceptions/gameballException.rb +5 -5
- data/lib/gameball/models/action.rb +14 -10
- data/lib/gameball/models/coupon.rb +44 -28
- data/lib/gameball/models/event.rb +33 -25
- data/lib/gameball/models/player.rb +36 -28
- data/lib/gameball/models/referral.rb +24 -20
- data/lib/gameball/models/transaction.rb +90 -64
- data/lib/gameball/utils/helper.rb +33 -34
- data/lib/gameball/utils/request.rb +81 -90
- data/lib/gameball/utils/validation.rb +11 -11
- data/lib/gameball/version.rb +3 -0
- metadata +56 -13
- data/lib/gameball/models/gameballResponse.rb +0 -0
- data/lib/testFile.rb +0 -87
@@ -1,18 +1,18 @@
|
|
1
1
|
module Gameball
|
2
2
|
module Utils
|
3
3
|
extend self
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
|
5
|
+
def validate(hash, required, optional)
|
6
|
+
errors = []
|
7
|
+
required.each do |val|
|
8
|
+
raise Gameball::GameballError.new("Required key: #{val.to_sym.inspect}") unless hash.has_key?(val.to_sym)
|
9
|
+
end
|
10
|
+
optional = optional + required
|
11
|
+
hash.each_key do |val|
|
12
|
+
unless optional.include?(val.to_s)
|
13
|
+
raise Gameball::GameballError.new("Unknown key: #{val.to_sym.inspect}. Valid keys are: #{optional.map(&:inspect).join(", ")}")
|
14
14
|
end
|
15
15
|
end
|
16
|
+
end
|
16
17
|
end
|
17
18
|
end
|
18
|
-
|
metadata
CHANGED
@@ -1,38 +1,81 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alphaSDK
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Alsouidan
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
12
|
-
dependencies:
|
13
|
-
|
14
|
-
|
11
|
+
date: 2020-08-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '12.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '12.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
41
|
+
description:
|
42
|
+
email:
|
43
|
+
- alsouidan@gmail.com
|
15
44
|
executables: []
|
16
45
|
extensions: []
|
17
46
|
extra_rdoc_files: []
|
18
47
|
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- ".rspec"
|
50
|
+
- ".travis.yml"
|
51
|
+
- CODE_OF_CONDUCT.md
|
52
|
+
- Gemfile
|
53
|
+
- Gemfile.lock
|
54
|
+
- LICENSE.txt
|
55
|
+
- README.md
|
56
|
+
- Rakefile
|
57
|
+
- bin/console
|
58
|
+
- bin/setup
|
59
|
+
- gameball.gemspec
|
19
60
|
- lib/gameball.rb
|
20
61
|
- lib/gameball/exceptions/gameballException.rb
|
21
62
|
- lib/gameball/models/action.rb
|
22
63
|
- lib/gameball/models/coupon.rb
|
23
64
|
- lib/gameball/models/event.rb
|
24
|
-
- lib/gameball/models/gameballResponse.rb
|
25
65
|
- lib/gameball/models/player.rb
|
26
66
|
- lib/gameball/models/referral.rb
|
27
67
|
- lib/gameball/models/transaction.rb
|
28
68
|
- lib/gameball/utils/helper.rb
|
29
69
|
- lib/gameball/utils/request.rb
|
30
70
|
- lib/gameball/utils/validation.rb
|
31
|
-
- lib/
|
32
|
-
homepage:
|
71
|
+
- lib/gameball/version.rb
|
72
|
+
homepage: http://mygemserver.com
|
33
73
|
licenses:
|
34
74
|
- MIT
|
35
|
-
metadata:
|
75
|
+
metadata:
|
76
|
+
homepage_uri: http://mygemserver.com
|
77
|
+
source_code_uri: http://mygemserver.com
|
78
|
+
changelog_uri: http://mygemserver.com
|
36
79
|
post_install_message:
|
37
80
|
rdoc_options: []
|
38
81
|
require_paths:
|
@@ -41,7 +84,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
41
84
|
requirements:
|
42
85
|
- - ">="
|
43
86
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
87
|
+
version: 2.3.0
|
45
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
89
|
requirements:
|
47
90
|
- - ">="
|
@@ -51,5 +94,5 @@ requirements: []
|
|
51
94
|
rubygems_version: 3.0.3
|
52
95
|
signing_key:
|
53
96
|
specification_version: 4
|
54
|
-
summary:
|
97
|
+
summary: Ruby gem
|
55
98
|
test_files: []
|
File without changes
|
data/lib/testFile.rb
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
require_relative './gameball'
|
2
|
-
Gameball::api_key="7c7636658209418c9a82306a421f76a5"
|
3
|
-
Gameball::api_version="v2.0"
|
4
|
-
Gameball::transaction_key="26e1967d89114388bdd1772587c336c8"
|
5
|
-
# res=Gameball::Transaction.get_player_balance("uniqueKey00")
|
6
|
-
res=Gameball::Player.initialize_player({playerUniqueId:"uniquekeys120",playerAttributes:
|
7
|
-
{displayName:"Souidan",firstName:"Souidan1",lastName:"Souidan2",email:"alisouidan@gmail.com",
|
8
|
-
gender:"Male",mobileNumber:"+201002580909",
|
9
|
-
dateOfBirth:Date.parse("10/10/2010"),joinDate:Time.now.utc
|
10
|
-
}})
|
11
|
-
# res=Gameball::Transaction.hold_points({
|
12
|
-
# playerUniqueId:"uniqueKey00",
|
13
|
-
# amount:2,
|
14
|
-
# transactionTime:Time.now.utc
|
15
|
-
# })
|
16
|
-
# res=Gameball::Transaction.redeem_points({
|
17
|
-
# holdReference:"c61153e4-fc79-4b1c-adce-f789bc061fe9",
|
18
|
-
# playerUniqueId:"uniqueKey00",
|
19
|
-
# amount:2,
|
20
|
-
# transactionOnClientSystemId:12,
|
21
|
-
# transactionTime:Time.now.utc
|
22
|
-
# })
|
23
|
-
# res=Gameball::Transaction.reverse_transaction({
|
24
|
-
# playerUniqueId:"uniqueKey00",
|
25
|
-
# transactionOnClientSystemId:12,
|
26
|
-
# reversedTransactionOnClientSystemId:12,
|
27
|
-
# transactionTime:Time.now.utc
|
28
|
-
# })
|
29
|
-
# res=Gameball::Transaction.reverse_hold({
|
30
|
-
# playerUniqueId:"uniqueKey00",
|
31
|
-
# holdReference:"80144eaa-8e5b-4c6b-8f4d-58f0d8766797",
|
32
|
-
# transactionTime:Time.now.utc
|
33
|
-
# })
|
34
|
-
|
35
|
-
# res=Gameball::Referral.create_referral({
|
36
|
-
# playerCode:"CODE11",
|
37
|
-
# playerUniqueId:"player456"
|
38
|
-
# }
|
39
|
-
# )
|
40
|
-
# res=Gameball::Player.get_player_info("uniqueKey00")
|
41
|
-
# res=Gameball::Transaction.reward_points({
|
42
|
-
# playerUniqueId:"uniqueKey00",
|
43
|
-
# amount:100,
|
44
|
-
# transactionTime:Time.now.utc,
|
45
|
-
# transactionOnClientSystemId:"1232344",
|
46
|
-
|
47
|
-
# })
|
48
|
-
# res=Gameball::Event.sendEvent({
|
49
|
-
# events:{
|
50
|
-
# reserve:{
|
51
|
-
# rooms:2
|
52
|
-
# }
|
53
|
-
# },
|
54
|
-
# playerUniqueId:" player123",
|
55
|
-
# playerAttributes:{
|
56
|
-
# displayName:" Jon Snow",
|
57
|
-
# email:"jon.snow@example.com",
|
58
|
-
# dateOfBirth:"1980-09-19T00:00:00.000Z",
|
59
|
-
# joinDate:"2019-09-19T21:06:29.158Z",
|
60
|
-
# custom:{
|
61
|
-
# location:"Miami",
|
62
|
-
# graduationDate:"2018-07-04T21:06:29.158Z",
|
63
|
-
# isMarried:false
|
64
|
-
# }
|
65
|
-
|
66
|
-
# }
|
67
|
-
# }
|
68
|
-
|
69
|
-
|
70
|
-
# )
|
71
|
-
# res=Gameball::Event.sendEvent({
|
72
|
-
# events:{view_product_page:{customer_id:"123",product_id:"123",product_title:"title",product_vendor:"vendor",shop_name:"shop"}},
|
73
|
-
# playerUniqueId:"uniquekeys120",
|
74
|
-
# playerAttributes:{displayName:"Souidan",firstName:"Souidan1",lastName:"Souidan2",email:"alisouidan1@gmail.com",gender:"Male",mobileNumber:"+201002580909",dateOfBirth:"0123",joinDate:Time.now.utc}
|
75
|
-
# })
|
76
|
-
p res.body
|
77
|
-
# p res
|
78
|
-
# # puts Gameball::Helper::hashBody(playerUniqueId:"123",transactionId:"34",transactionTime:Time.now.utc)
|
79
|
-
# res=Gameball::Event.sendEvent({
|
80
|
-
# events:{view_product_page:{customer_id:"123",product_id:"123",product_title:"title",product_vendor:"vendor",shop_name:"shop"}},
|
81
|
-
# playerUniqueId:"uinqueKeys123"
|
82
|
-
# }) #Check the sinatra server window for the output.
|
83
|
-
# p res
|
84
|
-
# sleep 5 #Do some time consuming task.
|
85
|
-
# p res
|
86
|
-
# puts "Sending response..."
|
87
|
-
# #The response(which the rails app ignores).
|