Module: TimeOfDayAttr::ActiveRecordExtension::ClassMethods

Defined in:
lib/time_of_day_attr/active_record_extension.rb

Instance Method Summary collapse

Instance Method Details

#time_of_day_attr(*attrs) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/time_of_day_attr/active_record_extension.rb', line 6

def time_of_day_attr(*attrs)
  options = attrs.extract_options!

  writers = AttrWriterModule.new(attrs, options)

  if options[:prepend]
    prepend writers
  else
    include writers
  end
end