Class: Regexp

Inherits:
Object show all
Defined in:
lib/json/add/core.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.json_create(object) ⇒ Object



137
138
139
# File 'lib/json/add/core.rb', line 137

def self.json_create(object)
  new(object['s'], object['o'])
end

Instance Method Details

#to_jsonObject



141
142
143
144
145
146
147
# File 'lib/json/add/core.rb', line 141

def to_json(*)
  {
    JSON.create_id => self.class.name,
    'o' => options,
    's' => source,
  }.to_json
end