bitballoon 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -22,18 +22,29 @@ You'll need an application client id and a client secret before you can access t
22
22
 
23
23
  Once you have your credentials you can instantiate a BitBalloon client.
24
24
 
25
- bitballoon = BitBalloon::Client.new(:client_id => "YOUR_API_KEY", :client_secret => "YOUR_API_SECRET")
25
+ ```ruby
26
+ bitballoon = BitBalloon::Client.new(:client_id => "YOUR_API_KEY", :client_secret => "YOUR_API_SECRET")
27
+ ```
26
28
 
27
29
  Before you can make any requests to the API, you'll need to authenticate with OAuth2. The BitBalloon client supports two OAuth2 flows.
28
30
 
29
31
  If you're authenticating on behalf of a user, you'll need to get a valid access token for that user. Use the BitBalloon client to request an authentication URL:
30
32
 
31
- url = bitballoon.authorize_url(:redirect_uri => "http://www.example.com/callback")
33
+ ```ruby
34
+ url = bitballoon.authorize_url(:redirect_urai => "http://www.example.com/callback")
35
+ ```
32
36
 
33
37
  The user then visits that URL and will be prompted to authorize your application to access his BitBalloon sites. If she grants permission, she'll be redirected back to the `redirect_uri` provided in the `authorize_url` call. This URL must match the redirect url configured for your BitBalloon application. Once the user comes back to your app, you'll be able to access a `code` query parameter that gives you an authorization code. Use this to finish the OAuth2 flow:
34
38
 
35
- bitballoon.authorize!(token, :redirect_uri => "http://www.example.com/callback")
39
+ ```ruby
40
+ bitballoon.authorize!(token, :redirect_uri => "http://www.example.com/callback")
41
+ ```
36
42
 
43
+ If you're not authenticating on behalf of a user you can authorize directly with the API credentials. Just call:
44
+
45
+ ```ruby
46
+ bitballoon.authorize_from_credentials!
47
+ ```
37
48
 
38
49
  Sites
39
50
  =====
@@ -36,6 +36,14 @@ module BitBalloon
36
36
  Sites.new(self)
37
37
  end
38
38
 
39
+ def forms
40
+ Forms.new(self)
41
+ end
42
+
43
+ def submissions
44
+ Submissions.new(self)
45
+ end
46
+
39
47
  def request(verb, path, opts={}, &block)
40
48
  raise "Authorize with BitBalloon before making requests" unless oauth_token
41
49
  oauth_token.request(verb, ::File.join("/api", API_VERSION, path), opts, &block)
@@ -1,3 +1,3 @@
1
1
  module BitBalloon
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitballoon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: