Sha256: ada175474bbf544a969e25e57e71a56c10a644f9493cb60d02eb8d76e392d617

Contents?: true

Size: 316 Bytes

Versions: 3

Compression:

Stored size: 316 Bytes

Contents

class FieldForm

  def self.define(field)
    field.model.form_object.instance_eval do
      define_method field.name do
        memoize field.name do
          Option[model.send(field.name)].flatten.value_or nil if model.data.has_key? field.key
        end
      end
      attr_writer field.name
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
id-0.0.12 lib/id/form/field_form.rb
id-0.0.11 lib/id/form/field_form.rb
id-0.0.10 lib/id/form/field_form.rb