awardflair 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
@@ -44,7 +44,13 @@ Or install it yourself as:
44
44
 
45
45
  # Award a badge by email (also gets you a link that you can give to the user.)
46
46
  first_badge = pf.badges.first # Getting the first badge you created.
47
- first_badge.award_to("email_address@mydomain.com")
47
+ first_badge.award_to("email_address@mydomain.com", :send_email => true)
48
+
49
+ # Note that send_email is an option, not a requirement. Default is false.
50
+ # If you do not send an email, the user can still claim their badge by creating a PF account using that email address or by following the link you provide (which you could show to them or email to them through your own app instead of via PickFlair).
51
+ # If they have an account at PF, they are automatically awarded the badge.
52
+ # Here's an example with no email notification:
53
+ award_link = first_badge.award_to("email_address@mydomain.com")
48
54
 
49
55
  ## Contributing
50
56
 
@@ -24,8 +24,8 @@ class PFBadge
24
24
  pickflair_instance.award_badge(@id)
25
25
  end
26
26
 
27
- def award_to(email_of_recipient)
28
- pickflair_instance.award_badge_by_email(@id, email_of_recipient)
27
+ def award_to(email_of_recipient, options={})
28
+ pickflair_instance.award_badge_by_email(@id, email_of_recipient, options)
29
29
  end
30
30
  end
31
31
 
@@ -66,8 +66,8 @@ class PickFlair
66
66
  api_response.parsed_response["data"]["badge_awarding_url"]
67
67
  end
68
68
 
69
- def award_badge_by_email(badge_identifier, email_of_recipient)
70
- api_response = self.class.post("/email_awards.json", :body => token.merge(:badge_id => badge_identifier, :email => email_of_recipient))
69
+ def award_badge_by_email(badge_identifier, email_of_recipient, options={})
70
+ api_response = self.class.post("/email_awards.json", :body => token.merge(:badge_id => badge_identifier, :email => email_of_recipient).merge(options))
71
71
  api_response.parsed_response["data"]["badge_award_url"]
72
72
  end
73
73
 
@@ -1,3 +1,3 @@
1
1
  module Awardflair
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: awardflair
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:
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: 81905120224148450
96
+ hash: 653363223393570127
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  none: false
99
99
  requirements:
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  segments:
104
104
  - 0
105
- hash: 81905120224148450
105
+ hash: 653363223393570127
106
106
  requirements: []
107
107
  rubyforge_project:
108
108
  rubygems_version: 1.8.24