Module: Transit::Extension::Loader

Defined in:
lib/transit/extension.rb

Overview

Methods included by each deliverable to provide extension loading functionality

Instance Method Summary collapse

Instance Method Details

#deliver_with(*args) ⇒ Object Also known as: add_extension

Deliverables can include a number of other packages and delivery options. To include them pass them to this method.

Examples:

Deliver a resource with attachments

deliver_with :attachments


50
51
52
53
54
55
56
57
58
59
# File 'lib/transit/extension.rb', line 50

def deliver_with(*args)
  options = args.extract_options!.symbolize_keys!
  [args, options.keys].flatten.compact.each do |arg|
    extname = arg.to_s.camelize
    unless Transit::Extension.const_defined?(extname)
      raise Transit::Extension::MissingExtensionError.new("The extension #{extname} could not be found.")
    end
    include Transit::Extension.const_get(extname)
  end
end