class MailControl::Definition
Attributes
act_object[R]
act_target[R]
actor[R]
bond_type[R]
grouped_actor[R]
name[R]
options[R]
unsubscribe_by[R]
Public Class Methods
find(name)
click to toggle source
# File lib/mail-control/definition.rb, line 40 def self.find(name) unless definition = registered.find{|definition| definition.name == name.to_sym} raise MailControl::InvalidLoggedEmail, "Could not find a definition for `#{name}`" else definition end end
new(definition)
click to toggle source
@param dsl [MailControl::DefinitionDSL] A DSL act_object
# File lib/mail-control/definition.rb, line 10 def initialize(definition) @name = definition[:name] @actor = definition[:actor] || nil @act_object = definition[:act_object] || nil @act_target = definition[:act_target] || nil @grouped_actor = definition[:grouped_actor] || nil @bond_type = definition[:bond_type] || nil @options = definition[:options] || [] @unsubscribe_by = definition[:unsubscribe_by] || nil end
register(definition)
click to toggle source
Registers a new definition
@param definition [Definition] The definition to register @return [Definition] Returns the registered definition
# File lib/mail-control/definition.rb, line 27 def self.register(definition) return false unless definition.is_a? DefinitionDSL definition = new(definition) self.registered << definition return definition || false end
registered()
click to toggle source
List of registered definitions @return [Array<MailControl::Definition>]
# File lib/mail-control/definition.rb, line 36 def self.registered @definitions ||= [] end