class String - Oj

# class String

More monkey patches.

### Public Class Methods

json_create(obj) click to toggle source

    # File lib/oj/mimic.rb, line 258
    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

### Public Instance Methods

to_json_raw(*) click to toggle source

    # File lib/oj/mimic.rb, line 255
    def to_json_raw(*)
     to_json_raw_object().to_json()
    end

to_json_raw_object() click to toggle source

    # File lib/oj/mimic.rb, line 249
    def to_json_raw_object
      {
        JSON.create_id => self.class.name,
        'raw' => self.bytes
      }
    end