lucid_intercom 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -22
- data/lib/lucid_intercom/attributes.rb +10 -42
- data/lib/lucid_intercom/changed_plan_event.rb +31 -0
- data/lib/lucid_intercom/company_attributes.rb +21 -0
- data/lib/lucid_intercom/company_custom_attributes.rb +48 -0
- data/lib/lucid_intercom/config.rb +44 -0
- data/lib/lucid_intercom/convert.rb +32 -0
- data/lib/lucid_intercom/{errors/error.rb → error.rb} +0 -0
- data/lib/lucid_intercom/event.rb +77 -0
- data/lib/lucid_intercom/installed_event.rb +31 -0
- data/lib/lucid_intercom/post_request.rb +26 -0
- data/lib/lucid_intercom/render_snippet.rb +28 -24
- data/lib/lucid_intercom/response.rb +51 -0
- data/lib/lucid_intercom/send_event.rb +22 -60
- data/lib/lucid_intercom/snippet.html.erb +2 -14
- data/lib/lucid_intercom/uninstalled_event.rb +27 -0
- data/lib/lucid_intercom/update_user.rb +24 -54
- data/lib/lucid_intercom/user_attributes.rb +47 -0
- data/lib/lucid_intercom/version.rb +1 -1
- data/lib/lucid_intercom.rb +18 -6
- metadata +56 -16
- data/lib/lucid_intercom/attributes/base.rb +0 -63
- data/lib/lucid_intercom/attributes/company.rb +0 -22
- data/lib/lucid_intercom/attributes/custom.rb +0 -47
- data/lib/lucid_intercom/attributes/user.rb +0 -28
- data/lib/lucid_intercom/credentials.rb +0 -35
- data/lib/lucid_intercom/errors/missing_credentials_error.rb +0 -7
- data/lib/lucid_intercom/errors/request_error.rb +0 -17
- data/lib/lucid_intercom/errors.rb +0 -3
- data/lib/lucid_intercom/events/base.rb +0 -23
- data/lib/lucid_intercom/events/changed_plan.rb +0 -37
- data/lib/lucid_intercom/events/installed.rb +0 -37
- data/lib/lucid_intercom/events/uninstalled.rb +0 -33
- data/lib/lucid_intercom/events.rb +0 -5
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'lucid_intercom/credentials'
|
4
|
-
require 'lucid_intercom/send_event'
|
5
|
-
require 'lucid_intercom/update_user'
|
6
|
-
require 'lucid_intercom/events/base'
|
7
|
-
|
8
|
-
module LucidIntercom
|
9
|
-
module Events
|
10
|
-
class Uninstalled < Base
|
11
|
-
def call
|
12
|
-
LucidIntercom::UpdateUser.new(shop_attributes, {plan: nil}, credentials).()
|
13
|
-
LucidIntercom::SendEvent.new(shop_attributes, credentials).(event_name, event_metadata)
|
14
|
-
end
|
15
|
-
|
16
|
-
#
|
17
|
-
# @return [String]
|
18
|
-
#
|
19
|
-
private def event_name
|
20
|
-
"#{credentials.app_prefix}_uninstalled"
|
21
|
-
end
|
22
|
-
|
23
|
-
#
|
24
|
-
# @return [Hash]
|
25
|
-
#
|
26
|
-
private def event_metadata
|
27
|
-
{
|
28
|
-
company_id: shop_attributes['myshopify_domain'],
|
29
|
-
}
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|