Sha256: 0c8b7d92884e81e019dc109ba38e227733aa7e0a48cebee4e49cccbaa40035e9

Contents?: true

Size: 353 Bytes

Versions: 1

Compression:

Stored size: 353 Bytes

Contents

module Larynx
  class Form < Application
    include Fields
    class_inheritable_accessor :setup_block

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

    def run
      instance_eval &self.class.setup_block if self.class.setup_block
      next_field
    end

    def restart_form
      @field_index = -1
      run
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
larynx-0.1.5 lib/larynx/form.rb