-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
18 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
# TODO: ClickEvent and OpenEvent should inherit from the same interface | ||
|
||
class Types::ClickEventType < Types::BaseObject | ||
implements Types::UserAgentEventType | ||
|
||
description "Information about someone clicking on a link in an email" | ||
field :created_at, Types::DateTimeType, null: true, description: "When the click happened" | ||
field :url, String, null: false, description: "The URL of the link" | ||
field :user_agent, Types::FamilyAndVersionType, null: true, description: "Information about the browser/mail reader" | ||
def user_agent | ||
{ family: object.calculate_ua_family, version: object.calculate_ua_version } | ||
end | ||
field :os, Types::FamilyAndVersionType, null: true, description: "The operating system the person was using" | ||
def os | ||
{ family: object.calculate_os_family, version: object.calculate_os_version } | ||
end | ||
field :ip, String, null: true, description: "The IP address the click originated from" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,5 @@ | ||
class Types::OpenEventType < Types::BaseObject | ||
implements Types::UserAgentEventType | ||
|
||
description "Information about someone opening an email" | ||
field :created_at, Types::DateTimeType, null: true, description: "When the email was opened" | ||
field :user_agent, Types::FamilyAndVersionType, null: true, description: "The browser / email client that was being used" | ||
def user_agent | ||
{ family: object.ua_family, version: object.ua_version } | ||
end | ||
field :os, Types::FamilyAndVersionType, null: true, description: "The operating system that was being used at the time" | ||
def os | ||
{ family: object.os_family, version: object.os_version } | ||
end | ||
field :ip, String, null: true, description: "The originating IP address" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Types::UserAgentEventType | ||
include Types::BaseInterface | ||
description "An event initiated by someone from a browser / email client" | ||
field :created_at, Types::DateTimeType, null: true, description: "The time of the event" | ||
field :user_agent, Types::FamilyAndVersionType, null: true, description: "The browser / email client being used" | ||
def user_agent | ||
{ family: object.calculate_ua_family, version: object.calculate_ua_version } | ||
end | ||
field :os, Types::FamilyAndVersionType, null: true, description: "The operating system being used" | ||
def os | ||
{ family: object.calculate_os_family, version: object.calculate_os_version } | ||
end | ||
field :ip, String, null: true, description: "The originating IP address" | ||
end |