Class: Regexp

Inherits:
Object show all
Defined in:
lib/vendor/dataflow/dataflow/equality.rb,
lib/vendor/json_pure/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/vendor/json_pure/lib/json/add/core.rb', line 137

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

Instance Method Details

#==(other) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/vendor/dataflow/dataflow/equality.rb', line 21

def ==(other)
  other.is_a?(Regexp) && 
  casefold? == other.casefold? &&
  kcode == other.kcode &&
  options == other.options &&
  source == other.source
end

#to_jsonObject



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

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