Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into user-tagging-refactored

Conflicts:
	changes.txt
  • Loading branch information...
commit 1a2fcb50c331a2d73b4325ac0bafe43ff402d81a 2 parents 0977ab1 + c9177ef
@erskingardner erskingardner authored
View
1  README.md
@@ -74,4 +74,5 @@ You can also pass custom data within a company:
Intercom::AuthenticationError
Intercom::ServerError
+ Intercom::ServiceUnavailableError
Intercom::ResourceNotFound
View
7 changes.txt
@@ -1,6 +1,9 @@
-0.1.6
+0.1.7
- add support for creating, updating, and fetching tags
+0.1.6
+ - add unsubscribed_from_emails and unsubscribed_from_emails= to user
+
0.1.5
- always convert times to unix timestamps for the wire (thanks @jgwhite)
@@ -42,4 +45,4 @@
- updates to reflect changes to resources served by the api
0.0.1
- - experimental version
+ - experimental version
View
14 lib/intercom/user.rb
@@ -195,6 +195,20 @@ def created_at=(time)
end
##
+ # Get whether user has unsubscribed from email
+ # @return [Boolean]
+ def unsubscribed_from_emails
+ @attributes['unsubscribed_from_emails']
+ end
+
+ ##
+ # Set whether user has unsubscribed from email
+ # @return [void]
+ def unsubscribed_from_emails=(unsubscribed_from_emails)
+ @attributes['unsubscribed_from_emails'] = unsubscribed_from_emails
+ end
+
+ ##
# Get array of Intercom::SocialProfile objects attached to this Intercom::User
#
# See http://docs.intercom.io/#SocialProfiles for more information
View
2  lib/intercom/version.rb
@@ -1,3 +1,3 @@
module Intercom #:nodoc:
- VERSION = "0.1.6"
+ VERSION = "0.1.7"
end
View
3  spec/spec_helper.rb
@@ -14,6 +14,7 @@ def test_user(email="bob@example.com")
:relationship_score => 90,
:session_count => 123,
:last_impression_at => 1323422442,
+ :unsubscribed_from_emails => true,
:social_profiles => [
{"type" => "twitter", "url" => "http://twitter.com/abc", "username" => "abc"},
{"type" => "twitter", "username" => "abc2", "url" => "http://twitter.com/abc2"},
@@ -115,4 +116,4 @@ def array.shuffle
self
end
array
-end
+end
View
1  spec/unit/intercom/user_spec.rb
@@ -42,6 +42,7 @@
user.relationship_score.must_equal 90
user.last_seen_ip.must_equal "1.2.3.4"
user.last_seen_user_agent.must_equal "Mozilla blah blah ie6"
+ user.unsubscribed_from_emails.must_equal true
end
it "has read-only social accounts" do
Please sign in to comment.
Something went wrong with that request. Please try again.