Module: DataMapper::Property::Flags::ClassMethods

Defined in:
lib/dm-types/support/flags.rb

Instance Method Summary collapse

Instance Method Details

#[](*values) ⇒ Object

TODO: document



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/dm-types/support/flags.rb', line 26

def [](*values)
  if klass = generated_classes[values.flatten]
    klass
  else
    klass = ::Class.new(self)
    klass.flags(values)

    generated_classes[values.flatten] = klass

    klass
  end
end