Last active
March 11, 2025 22:12
-
-
Save svoop/25accb41d09a667e54c98b6f04a21fdd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# All class methods (original) | |
# Usage: Mailjet::WebhookService::Event.all | |
module Mailjet | |
module WebhookService | |
class Base | |
class << self | |
def domain(prefix=nil) | |
end | |
def webhook_url_for(path) | |
end | |
end | |
end | |
# Wrapper around Mailjet Event API calls | |
class Event < Base | |
class << self | |
def all | |
end | |
def create(event:, path:) | |
end | |
def clear | |
end | |
end | |
end | |
# Wrapper around Mailjet Parse API calls | |
class Parse < Base | |
class << self | |
def all | |
end | |
def create(prefix:, path:) | |
end | |
def clear(prefix:) | |
end | |
end | |
end | |
end | |
end |
This file contains hidden or 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
# Self extended modules (alternative) | |
# Usage: Mailjet::WebhookService::Event.all | |
module Mailjet | |
module WebhookService | |
module Base | |
private | |
def domain(prefix=nil) | |
end | |
def webhook_url_for(path) | |
end | |
end | |
# Wrapper around Mailjet Event API calls | |
module Event | |
include Base | |
extend self | |
def all | |
end | |
def create(event:, path:) | |
end | |
def clear | |
end | |
end | |
# Wrapper around Mailjet Parse API calls | |
module Parse | |
include Base | |
extend self | |
def all | |
end | |
def create(prefix:, path:) | |
end | |
def clear(prefix:) | |
end | |
end | |
end | |
end |
This file contains hidden or 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
# Singleton instances (alternative) | |
# Usage: Mailjet::WebhookService.event.all | |
module Mailjet | |
module WebhookService | |
class Base | |
private | |
def domain(prefix=nil) | |
end | |
def webhook_url_for(path) | |
end | |
end | |
# Wrapper around Mailjet Event API calls | |
class Event < Base | |
def all | |
end | |
def create(event:, path:) | |
end | |
def clear | |
end | |
end | |
# Wrapper around Mailjet Parse API calls | |
class Parse < Base | |
def all | |
end | |
def create(prefix:, path:) | |
end | |
def clear(prefix:) | |
end | |
end | |
def self.event = @event ||= Event.new | |
def self.parse = @parse ||= Parse.new | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment