Class: Larynx::Form

Inherits:
Application show all
Includes:
Fields
Defined in:
lib/larynx/form.rb

Constant Summary collapse

@@setup =
nil

Instance Attribute Summary

Attributes inherited from Application

#call

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Fields

included

Methods inherited from Application

#initialize, #log, run

Constructor Details

This class inherits a constructor from Larynx::Application

Class Method Details

.setup(&block) ⇒ Object



6
7
8
# File 'lib/larynx/form.rb', line 6

def self.setup(&block)
  @@setup = block
end

Instance Method Details

#restart_formObject



15
16
17
18
# File 'lib/larynx/form.rb', line 15

def restart_form
  @current_field = 0
  run
end

#runObject



10
11
12
13
# File 'lib/larynx/form.rb', line 10

def run
  instance_eval &@@setup if @@setup
  next_field
end