Class: Array
Overview
has added a class generator when the fields are known apriori.
Direct Known Subclasses
Instance Attribute Summary
Attributes included from Fieldable
Class Method Summary collapse
- .fields(*fields) ⇒ Object (also: struct)
Methods included from Fieldable
Class Method Details
.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 |