Module: EOTS

Defined in:
lib/eots.rb,
lib/eots/engine.rb,
lib/eots/version.rb,
app/helpers/eots/application_helper.rb,
app/controllers/eots/eots_controller.rb

Defined Under Namespace

Modules: ApplicationHelper Classes: EOTSController, Email, EmailKind, Engine, Field, Mailer

Constant Summary collapse

STANDARD_FIELDS =

standard fields you’d see in any email

i(from to reply_to cc bcc subject)
NON_FIELD_ITEMS =

need a better short name for this… stuff we want to let the dev pass in the email_kind declaration, either as an option or in the block, other than fields.…

i(header footer)
VERSION =
"0.0.4"

Class Method Summary collapse

Class Method Details

.email_kind(name, options = {}, &block) ⇒ Object



17
18
19
20
21
22
# File 'lib/eots.rb', line 17

def self.email_kind(name, options={}, &block)
  kind = create_email_kind(name, options)
  @@kind_stack.push kind
  yield if block_given?
  @@kind_stack.pop
end

.field(name, label, options = {}) ⇒ Object



24
25
26
# File 'lib/eots.rb', line 24

def self.field(name, label, options={})
  @@kind_stack.last.add_field(name, label, options)
end

.find_kind(kind_name) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/eots.rb', line 28

def self.find_kind(kind_name)
  kind = @@kind_hash[kind_name]
  unless kind
    raise(EOTS::EmailKind:: NotFoundError,
          "Unknown email kind '#{kind_name}'")
  end
  kind
end