Method: Array.fields

Defined in:
lib/rq/arrayfields.rb

.fields(*fields) ⇒ Object Also known as: struct



288
289
290
291
292
293
294
295
296
297
298
# File 'lib/rq/arrayfields.rb', line 288

def fields *fields
  Class.new(self) do
    const_set :FIELDS, ArrayFields::FieldSet.new(fields.flatten)
    include ArrayFields
    def initialize *a, &b
      super
    ensure
      @fieldset = self.class.const_get :FIELDS
    end
  end
end