lib/larynx/form.rb in larynx-0.1.4 vs lib/larynx/form.rb in larynx-0.1.5
- old
+ new
@@ -1,20 +1,20 @@
module Larynx
class Form < Application
include Fields
- @@setup = nil
+ class_inheritable_accessor :setup_block
def self.setup(&block)
- @@setup = block
+ self.setup_block = block
end
def run
- instance_eval &@@setup if @@setup
+ instance_eval &self.class.setup_block if self.class.setup_block
next_field
end
def restart_form
- @current_field = 0
+ @field_index = -1
run
end
end
end