Module: Transit::Extension

Defined in:
lib/transit/extension.rb,
lib/transit/extensions/publishing.rb,
lib/transit/extensions/attachments.rb,
lib/transit/extensions/content_blocks.rb

Overview

Adds support for defining extensions to be utilized by deliverables. These are useful for providing global methods or functionality that can easily be used within any deliverable resource. Sure.. you could just write modules and include them, but this way is so much more Railsesque ;)

Defined Under Namespace

Modules: Attachments, ContentBlocks, Loader, Publishing Classes: MissingExtensionError

Class Method Summary (collapse)

Class Method Details

+ (Object) add(name, path = nil)

Extensions can be included from other gems or libraries. To enable autoloading of these extensions, add them with the .add method.



20
21
22
23
# File 'lib/transit/extension.rb', line 20

def add(name, path = nil)
  path ||= "transit/extensions/#{name.to_s.underscore}"
  self.send(:autoload, name.to_sym, path)
end

+ (Object) setup(klass, *methods)

Creates config accessors for a particular extension, within the included class. This allows options to be set on the model level with fallbacks to the global configuration.



30
31
32
# File 'lib/transit/extension.rb', line 30

def setup(klass, *methods)
  
end