Classes and Modules
Constants
| FRAMEWORKS | = | {} |
Map of framework type symbols to framework classes |
|
| MAJOR | = | 1 |
The major version of |
|
| MINOR | = | 14 |
The minor version of |
|
| MODELS | = | {} |
Map of model type symbols to model classes |
|
| TINY | = | 0 |
The patch version of |
|
| VERSION | = | "#{MAJOR}.#{MINOR}.#{TINY}".freeze |
Version constant, use |
|
| VERSION_NUMBER | = | MAJOR*10000 + MINOR*100 + TINY |
The full version of |
Public Class methods
Create a new set of model forms. Arguments:
| type |
A type symbol for the type of framework in use (:sinatra or :rails) |
| controller |
The controller class in which to load the forms |
| opts |
Options hash. Current supports a :prefix option if you want to mount the forms in a different prefix. |
Example:
AutoForme.for(:sinatra, Sinatra::Application, :prefix=>'/path') do model Artist end
# File lib/autoforme.rb 47 def self.for(type, controller, opts={}, &block) 48 Framework.for(type, controller, opts, &block) 49 end
Returns the version as a frozen string (e.g. ‘0.1.0’)
# File lib/autoforme/version.rb 22 def self.version 23 VERSION 24 end