Sha256: e9479adbaf103ffef1c5bce1548ee0e133bdc9d91ab59ab91c76cd41f8b3ebe7
Contents?: true
Size: 720 Bytes
Versions: 62
Compression:
Stored size: 720 Bytes
Contents
module Workarea class Content class Fieldset include AssetLookup attr_reader :fields attr_accessor :field_suffix, :name def initialize(name) @name = name @fields = [] end def field(name, type, options = {}) name = [name, field_suffix].join if field_suffix.present? klass = if type.is_a?(Class) type else "Workarea::Content::Fields::#{type.to_s.camelize}".constantize end if existing = @fields.detect { |f| f.name == name } existing.options.merge!(options) else @fields << klass.new(name, options) end end end end end
Version data entries
62 entries across 62 versions & 1 rubygems