Class: RbJSON5::EscapeSequence Private
- Inherits:
-
Object
- Object
- RbJSON5::EscapeSequence
- Defined in:
- lib/rb_json5/escape_sequence.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Utility class to unescape the given escape sequence
Instance Method Summary collapse
-
#initialize(sequence, valid_patterns = []) {|character, sequence| ... } ⇒ EscapeSequence
constructor
private
A new instance of EscapeSequence.
-
#to_s ⇒ String
private
returns the character unescaped from the given escape sequence.
Constructor Details
#initialize(sequence, valid_patterns = []) {|character, sequence| ... } ⇒ EscapeSequence
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of EscapeSequence.
18 19 20 21 |
# File 'lib/rb_json5/escape_sequence.rb', line 18 def initialize(sequence, valid_patterns = [], &ifinvalid) @character = unescape(sequence.to_s) validate(@character, sequence, valid_patterns, ifinvalid) end |
Instance Method Details
#to_s ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
returns the character unescaped from the given escape sequence
27 28 29 |
# File 'lib/rb_json5/escape_sequence.rb', line 27 def to_s @character end |