Sha256: ea7076bd68d5b38d7b70106b4bb97c858a46cdf602a4c94b893b10e458366199

Contents?: true

Size: 408 Bytes

Versions: 5

Compression:

Stored size: 408 Bytes

Contents

module ActiveElement
  class FieldOptions
    attr_accessor :type, :options
    attr_reader :field

    def self.from_state(field, state, record)
      block = state.field_options[field]
      return nil if block.blank?

      field_options = new(field)
      block.call(field_options, record)
      field_options
    end

    def initialize(field)
      @field = field
      @options = {}
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_element-0.0.19 lib/active_element/field_options.rb
active_element-0.0.18 lib/active_element/field_options.rb
active_element-0.0.17 lib/active_element/field_options.rb
active_element-0.0.16 lib/active_element/field_options.rb
active_element-0.0.15 lib/active_element/field_options.rb