Class: EJSONExt::Encoders::EscapeType
Instance Method Summary
collapse
Methods inherited from DefaultType
#initialize, #next_handler, #next_handler=, #parse
Instance Method Details
#handler? ⇒ Boolean
4
5
6
|
# File 'lib/ejson_ext/encoders/escape_type.rb', line 4
def handler?
@key == '$date' && !@value.is_a?(Time)
end
|
#key ⇒ Object
8
9
10
|
# File 'lib/ejson_ext/encoders/escape_type.rb', line 8
def key
'$escape'
end
|
#value ⇒ Object
12
13
14
|
# File 'lib/ejson_ext/encoders/escape_type.rb', line 12
def value
{ @key => @value }
end
|