Class: Regexp

Inherits:
Object
  • Object
show all
Defined in:
lib/client_side_validations/core_ext/regexp.rb

Instance Method Summary collapse

Instance Method Details

#as_jsonObject



4
5
6
# File 'lib/client_side_validations/core_ext/regexp.rb', line 4

def as_json(*)
  JsRegex.new(self).to_h
end

#encode_json(_encoder) ⇒ Object



12
13
14
# File 'lib/client_side_validations/core_ext/regexp.rb', line 12

def encode_json(_encoder)
  inspect
end

#to_json(options = nil) ⇒ Object



8
9
10
# File 'lib/client_side_validations/core_ext/regexp.rb', line 8

def to_json(options = nil)
  as_json(options)
end