mambanation 0.1.32 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +2 -2
- data/lib/mambanation/base.rb +9 -6
- metadata +6 -6
data/VERSION.yml
CHANGED
data/lib/mambanation/base.rb
CHANGED
@@ -4,16 +4,17 @@ module MambaNation
|
|
4
4
|
|
5
5
|
def_delegators :client, :get, :post, :put, :delete
|
6
6
|
|
7
|
-
attr_reader :client, :fbs_cookies
|
7
|
+
attr_reader :client, :fbs_cookies, :signed_request
|
8
8
|
|
9
|
-
def initialize(client,
|
9
|
+
def initialize(client, options = {})
|
10
10
|
@client = client
|
11
|
-
@fbs_cookies = fbs_cookies
|
11
|
+
@fbs_cookies = options.delete(:fbs_cookies) if options.has_key? :fbs_cookies
|
12
|
+
@signed_request = options.delete(:signed_request) if options.has_key? :signed_request
|
12
13
|
end
|
13
14
|
|
14
15
|
# Class method to fetch current user based on cookie
|
15
|
-
def self.current_user(client,
|
16
|
-
MambaNation::Base.new(client,
|
16
|
+
def self.current_user(client, options = {})
|
17
|
+
MambaNation::Base.new(client, options).current_user
|
17
18
|
end
|
18
19
|
|
19
20
|
#
|
@@ -241,7 +242,9 @@ module MambaNation
|
|
241
242
|
|
242
243
|
def request_options(opts={})
|
243
244
|
opts[:headers] ||= {}
|
244
|
-
opts[:headers].merge!
|
245
|
+
opts[:headers].merge!("X-FB-COOKIES" => @fbs_cookies) if @fbs_cookies
|
246
|
+
opts[:query] ||= {}
|
247
|
+
opts[:query].merge!("signed_request" => @signed_request) if @signed_request
|
245
248
|
opts
|
246
249
|
end
|
247
250
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mambanation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 21
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 2
|
8
9
|
- 1
|
9
|
-
|
10
|
-
version: 0.1.32
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "J\xC3\xA9r\xC3\xA9my Van de Wyngaert"
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date:
|
20
|
+
date: 2011-01-10 00:00:00 +01:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
224
|
requirements: []
|
225
225
|
|
226
226
|
rubyforge_project:
|
227
|
-
rubygems_version: 1.
|
227
|
+
rubygems_version: 1.4.2
|
228
228
|
signing_key:
|
229
229
|
specification_version: 3
|
230
230
|
summary: wrapper for mambanation-api
|