Skip to content

Instantly share code, notes, and snippets.

@svoop
Last active March 11, 2025 22:12
Show Gist options
  • Save svoop/25accb41d09a667e54c98b6f04a21fdd to your computer and use it in GitHub Desktop.
Save svoop/25accb41d09a667e54c98b6f04a21fdd to your computer and use it in GitHub Desktop.
# 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
# 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
# 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