Parent

Files

Regexp

Regexp serialization/deserialization

Public Class Methods

json_create(object) click to toggle source

Deserializes JSON string by constructing new Regexp object with source s (Regexp or String) and options o serialized by to_json

    # File lib/json/add/regexp.rb, line 11
11:   def self.json_create(object)
12:     new(object['s'], object['o'])
13:   end

Public Instance Methods

as_json(*) click to toggle source

Returns a hash, that will be turned into a JSON object and represent this object.

    # File lib/json/add/regexp.rb, line 17
17:   def as_json(*)
18:     {
19:       JSON.create_id => self.class.name,
20:       'o'            => options,
21:       's'            => source,
22:     }
23:   end
to_json(*) click to toggle source

Stores class name (Regexp) with options o and source s (Regexp or String) as JSON string

    # File lib/json/add/regexp.rb, line 27
27:   def to_json(*)
28:     as_json.to_json
29:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.