Module: AutoForme

Defined in:
lib/autoforme.rb,
lib/autoforme/model.rb,
lib/autoforme/table.rb,
lib/autoforme/action.rb,
lib/autoforme/request.rb,
lib/autoforme/version.rb,
lib/autoforme/framework.rb,
lib/autoforme/models/sequel.rb,
lib/autoforme/frameworks/roda.rb,
lib/autoforme/opts_attributes.rb,
lib/autoforme/frameworks/rails.rb,
lib/autoforme/frameworks/sinatra.rb

Defined Under Namespace

Modules: Frameworks, Models, OptsAttributes Classes: Action, Error, Framework, Model, Request, Table

Constant Summary collapse

FRAMEWORKS =

Map of framework type symbols to framework classes

{}
MODELS =

Map of model type symbols to model classes

{}
MAJOR =

The major version of AutoForme, updated only for major changes that are likely to require modification to apps using AutoForme.

1
MINOR =

The minor version of AutoForme, updated for new feature releases of AutoForme.

8
TINY =

The patch version of AutoForme, updated only for bug fixes from the last feature release.

0
VERSION =

Version constant, use AutoForme.version instead.

"#{MAJOR}.#{MINOR}.#{TINY}".freeze
VERSION_NUMBER =

The full version of AutoForme as a number (1.8.0 => 10800)

MAJOR*10000 + MINOR*100 + TINY

Class Method Summary collapse

Class Method Details

.for(type, controller, opts = {}, &block) ⇒ Object

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


48
49
50
# File 'lib/autoforme.rb', line 48

def self.for(type, controller, opts={}, &block)
  Framework.for(type, controller, opts, &block)
end

.versionObject

Returns the version as a frozen string (e.g. ‘0.1.0’)



22
23
24
# File 'lib/autoforme/version.rb', line 22

def self.version
  VERSION
end