beintoo 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/beintoo/model_additions.rb +5 -1
- data/lib/beintoo/player.rb +6 -0
- data/lib/beintoo/version.rb +1 -1
- data/lib/beintoo/vgood.rb +4 -2
- metadata +17 -22
@@ -26,7 +26,8 @@ module Beintoo
|
|
26
26
|
end
|
27
27
|
@beintoo_user
|
28
28
|
rescue Beintoo::UserAlreadyRegisteredException => e
|
29
|
-
|
29
|
+
@beintoo_user = nil
|
30
|
+
return Beintoo.get_connect_url self.send(par[:guid_field])
|
30
31
|
end
|
31
32
|
end
|
32
33
|
|
@@ -42,6 +43,9 @@ module Beintoo
|
|
42
43
|
@beintoo_user.list_rewards
|
43
44
|
end
|
44
45
|
|
46
|
+
define_method 'beintoo_rewards_iframe_url' do
|
47
|
+
@beintoo_player.rewards_iframe_url
|
48
|
+
end
|
45
49
|
end
|
46
50
|
end
|
47
51
|
end
|
data/lib/beintoo/player.rb
CHANGED
@@ -28,6 +28,9 @@ module Beintoo
|
|
28
28
|
result = Beintoo::get "#{RESOURCE}/login", headers, params_get
|
29
29
|
self.guid = result["guid"]
|
30
30
|
self.logged_in = true
|
31
|
+
if result.has_key? :playerScore
|
32
|
+
self.score = result[:playerScore]
|
33
|
+
end
|
31
34
|
if result.has_key? "user"
|
32
35
|
self.b_user = Beintoo::User.new result["user"].merge(guid: guid)
|
33
36
|
self.b_user.created = true
|
@@ -98,5 +101,8 @@ module Beintoo
|
|
98
101
|
Beintoo::Vgood.byplayer(self)
|
99
102
|
end
|
100
103
|
|
104
|
+
def rewards_iframe_url
|
105
|
+
"http://www.beintoo.com/m/marketplace.html?apikey=#{Beintoo::apikey}&guid=#{guid}"
|
106
|
+
end
|
101
107
|
end
|
102
108
|
end
|
data/lib/beintoo/version.rb
CHANGED
data/lib/beintoo/vgood.rb
CHANGED
@@ -2,7 +2,7 @@ module Beintoo
|
|
2
2
|
class Vgood
|
3
3
|
RESOURCE = "vgood"
|
4
4
|
|
5
|
-
ATTRIBUTES = %w{getRealURL showURL description descriptionSmall id imageUrl imageSmallUrl startdate enddate name bedollars discount VgoodPoiWrapper whoAlsoConverted categories isBanner contentType content rewardText shareURL uvext}
|
5
|
+
ATTRIBUTES = %w{getRealURL showURL description descriptionSmall id imageUrl imageSmallUrl startdate enddate name bedollars discount VgoodPoiWrapper whoAlsoConverted categories isBanner contentType content rewardText shareURL uvext vgoodPOIs}
|
6
6
|
|
7
7
|
ATTRIBUTES.each do |a|
|
8
8
|
self.send("attr_accessor", a)
|
@@ -10,7 +10,7 @@ module Beintoo
|
|
10
10
|
|
11
11
|
def initialize(params = {})
|
12
12
|
params.each do |a,v|
|
13
|
-
self.send("#{a}=", v)
|
13
|
+
self.send("#{a}=", v) rescue nil
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -63,6 +63,8 @@ module Beintoo
|
|
63
63
|
true
|
64
64
|
end
|
65
65
|
|
66
|
+
# see http://documentation.beintoo.com/home/api-docs/resources/vgood
|
67
|
+
# Returns a vgood, this method act as Vgood.getByUser but providing player guid instead of userExt.
|
66
68
|
def self.byplayer(player = nil)
|
67
69
|
raise Beintoo::ApiException, "Called Vgood.byplayer without passing a player!" if !player.logged_in?
|
68
70
|
headers = Beintoo::build_headers
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beintoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-03-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
17
|
-
requirement: &
|
17
|
+
requirement: &79066430 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *79066430
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: supermodel
|
28
|
-
requirement: &
|
28
|
+
requirement: &79066200 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *79066200
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: pry
|
39
|
-
requirement: &
|
39
|
+
requirement: &79065990 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *79065990
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rest-client
|
50
|
-
requirement: &
|
50
|
+
requirement: &79065730 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *79065730
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: rake
|
61
|
-
requirement: &
|
61
|
+
requirement: &79065290 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: '0'
|
67
67
|
type: :runtime
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *79065290
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: json
|
72
|
-
requirement: &
|
72
|
+
requirement: &79064960 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: '0'
|
78
78
|
type: :runtime
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *79064960
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: activesupport
|
83
|
-
requirement: &
|
83
|
+
requirement: &79064540 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ! '>='
|
@@ -88,7 +88,7 @@ dependencies:
|
|
88
88
|
version: '0'
|
89
89
|
type: :runtime
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *79064540
|
92
92
|
description: This gem tries to wrap the Beintoo API (http://documentation.beintoo.com)
|
93
93
|
to a ruby friendly Module meant to be used within Ruby on Rails applications
|
94
94
|
email:
|
@@ -134,18 +134,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
134
134
|
- - ! '>='
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
|
-
segments:
|
138
|
-
- 0
|
139
|
-
hash: -40742333141001870
|
140
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
138
|
none: false
|
142
139
|
requirements:
|
143
140
|
- - ! '>='
|
144
141
|
- !ruby/object:Gem::Version
|
145
142
|
version: '0'
|
146
|
-
segments:
|
147
|
-
- 0
|
148
|
-
hash: -40742333141001870
|
149
143
|
requirements: []
|
150
144
|
rubyforge_project: beintoo
|
151
145
|
rubygems_version: 1.8.10
|
@@ -158,3 +152,4 @@ test_files:
|
|
158
152
|
- spec/beintoo/model_additions_spec.rb
|
159
153
|
- spec/beintoo/real_usage_spec.rb
|
160
154
|
- spec/spec_helper.rb
|
155
|
+
has_rdoc:
|