W3cubDocs

/Padrino

Module: Padrino::Module

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#root(*args) ⇒ String

Helper method for file references within a Padrino module.

Examples:

module MyModule
  extend Padrino::Module
  gem! 'my_gem'
end
Module.root!

Parameters:

Returns:

  • (String) — The absolute path.

Instance Method Details

#dependency_paths ⇒ Array<String>

Returns the list of path globs to load as dependencies. Appends custom dependency patterns to the be loaded for Padrino.

Examples:

module MyModule
  extend Padrino::Module
  gem! 'my_gem'
end

Module.dependency_paths << "#{MyModule.root}/uploaders/*.rb"

Returns:

  • (Array<String>) — The dependency paths.

#gem!(name) ⇒ Object

Register this module as being loaded from a gem. This automatically sets the root and therefore the dependency paths correctly.

Parameters:

  • name (String) — The name of the gem. Has to be the name as stated in the gemspec.

© 2010–2016 Padrino
Licensed under the MIT License.
http://www.rubydoc.info/github/padrino/padrino-framework/Padrino/Module