Method: DataMapper::Property::Flag#initialize

Defined in:
lib/dm-types/flag.rb

#initialize(model, name, options = {}) ⇒ Flag

Returns a new instance of Flag.



10
11
12
13
14
15
16
17
18
19
# File 'lib/dm-types/flag.rb', line 10

def initialize(model, name, options = {})
  super

  @flag_map = {}

  flags = options.fetch(:flags, self.class.flags)
  flags.each_with_index do |flag, i|
    flag_map[i] = flag
  end
end