Class: DataMapper::Property::Regexp

Inherits:
String
  • Object
show all
Defined in:
lib/dm-types/regexp.rb

Instance Method Summary collapse

Instance Method Details

#dump(value) ⇒ Object



12
13
14
# File 'lib/dm-types/regexp.rb', line 12

def dump(value)
  value.source unless value.nil?
end

#load(value) ⇒ Object



8
9
10
# File 'lib/dm-types/regexp.rb', line 8

def load(value)
  ::Regexp.new(value) unless value.nil?
end

#typecast(value) ⇒ Object



16
17
18
# File 'lib/dm-types/regexp.rb', line 16

def typecast(value)
  load(value)
end