Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/oj/mimic.rb
Overview
More monkey patches.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.json_create(obj) ⇒ Object
294 295 296 297 298 299 300 301 302 |
# File 'lib/oj/mimic.rb', line 294 def self.json_create(obj) s = '' s.encode!(Encoding::ASCII_8BIT) if s.respond_to?(:encode!) raw = obj['raw'] if raw.is_a? Array raw.each { |v| s << v } end s end |
Instance Method Details
#to_json_raw ⇒ Object
291 292 293 |
# File 'lib/oj/mimic.rb', line 291 def to_json_raw(*) to_json_raw_object().to_json() end |
#to_json_raw_object ⇒ Object
285 286 287 288 289 290 |
# File 'lib/oj/mimic.rb', line 285 def to_json_raw_object { JSON.create_id => self.class.name, 'raw' => self.bytes } end |