Converts the notice to JSON. Calls +to_json+ on each object inside
 notice's payload. Truncates notices, JSON representation of which is
 bigger than {MAX_NOTICE_SIZE}.

 @return [Hash{String=>String}, nil]
161457
def to_json
      loop do
        begin
          json = @payload.to_json
        rescue *JSON_EXCEPTIONS => ex
          @config.logger.debug("#{LOG_LABEL} `notice.to_json` failed: #{ex.class}: #{ex}")
        else
          return json if json && json.bytesize <= MAX_NOTICE_SIZE
        end

        break if truncate == 0
      end
    end
1044741
def as_json(options = {})
      {name: self.name, title: self.title}.merge(options).tap do |options|
        fields.each {|f| options.merge!({f.code_name.to_sym => f.get_value_for(self)})}
      end
    end
862608
def ToJson(self):
        
        jsn = super(MinerTransaction, self).ToJson()
        jsn['nonce'] = self.Nonce
        return jsn
767282
def to_h
      @size_dep.depend

      if @attributes.nil?
        nil
      else
        hash = {}
        @attributes.each_pair do |key, value|
          hash[key] = deep_unwrap(value)
        end
        hash
      end
    end
875553
def mail_partial_json(self):
        
        if self.mail_partial.get("date"):
            self._mail_partial["date"] = self.date.isoformat()
        return json.dumps(self.mail_partial, ensure_ascii=False, indent=2)
657871
def to_json(self, indent=4):
        
        agregate = {
            'metas': self.metas,
        }

        agregate.update({k: getattr(self, k) for k in self._rule_attrs})

        return json.dumps(agregate, indent=indent)
833099
def ToJson(self):
        
        name = 'Contract'

        try:
            name = self.Name.decode('utf-8')
        except Exception as e:
            pass

        jsn = {'version': self.StateVersion}

        jsn_code = self.Code.ToJson()

        jsn_contract = {
            'name': name,
            'code_version': self.CodeVersion.decode('utf-8'),
            'author': self.Author.decode('utf-8'),
            'email': self.Email.decode('utf-8'),
            'description': self.Description.decode('utf-8'),
            'properties': {
                'storage': self.HasStorage,
                'dynamic_invoke': self.HasDynamicInvoke,
                'payable': self.Payable
            }
        }

        jsn.update(jsn_code)
        jsn.update(jsn_contract)

        if self._nep_token:
            jsn['token'] = self._nep_token.ToJson()

        return jsn
590366
def as_json(options=nil)
      actions = []
      indices.add_indices.each do |index|
        operation = { :index => index, :alias => name }
        operation.update( { :routing => routing } ) if respond_to?(:routing) and routing
        operation.update( { :filter  => filter } )  if respond_to?(:filter)  and filter
        actions.push( { :add => operation } )
      end

      indices.remove_indices.each do |index|
        operation = { :index => index, :alias => name }
        actions.push( { :remove => operation } )
      end

      { :actions => actions }
    end
368581
def convert
      old = @hashes
      @hashes = Hash.new

      puts 'Warning: old JSON format detected, converting.'
      old.each {|i| add_hash(i[:id], i[:deletehash], 'unknown') }
      save
    end
411465
def to_json(*a)
      { :item => if item then
                   item.name
                 else
                   nil
                 end,
        :tag  => if tag then
                   tag.name
                 else
                   nil
                 end,
        :src  => path_from_catalog_root }.to_json(*a)
    end
373905
def index
      @announcements = Announcement.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @announcements }
      end
    end
1230563
function toJSON() {
      const model = this.toObject()
      delete model.password
      delete model.salt

      // Return the modified user object.
      return utils.remove_null_undefined(model)
    }
1009465
def to_json(self):
    
    return {
        "build_number": self._build_number,
        "commit_hash": self._commit_hash,
        "last_modified": self._last_modified,
        "location": self._location,
        "modified_by": self._modified_by,
        "status": self._status,
        "value": self._value,
        "version_id": self._version_id
    }
40244
def to_json(opts={})
      hsh = self.to_ordered_hash(opts)
      if opts.fetch(:pretty, false)
        JSON.pretty_generate(hsh)
      else
        hsh.to_json
      end
    end
81437
def ToJson(self, index):
        
        return {
            'n': index,
            'asset': self.AssetId.To0xString(),
            'value': self.Value.ToNeoJsonString(),
            'address': self.Address
        }
287433
def to_s(filter = nil, version = nil)
      log_msg = "#{super(filter, version)} #{trace}"
      log_msg += " from #{id_to_s(@from)}" if filter.nil? || filter.include?(:from)
      log_msg += " to #{id_to_s(@to)}" if filter.nil? || filter.include?(:to)
      log_msg += ", request_from #{id_to_s(@request_from)}" if @request_from && (filter.nil? || filter.include?(:request_from))
      log_msg += ", persistent" if @persistent && (filter.nil? || filter.include?(:persistent))
      log_msg += ", tries #{tries_to_s}" if @tries && !@tries.empty? && (filter.nil? || filter.include?(:tries))
      if filter.nil? || !filter.include?(:results)
        if !@results.nil?
          if @results.is_a?(RightScale::OperationResult)   # Will be true when logging a 'SEND'
            res = @results
          elsif @results.is_a?(Hash) && @results.size == 1 # Will be true when logging a 'RECV' for version 9 or below
            res = @results.values.first
          end
          log_msg += " #{res.to_s}" if res
        end
      else
        log_msg += " results #{@results.inspect}"
      end
      log_msg
    end
925800
def to_json_string(self, indent=None):
        ''' 

        '''
        root_ids = []
        for r in self._roots:
            root_ids.append(r.id)

        root_references = self._all_models.values()

        json = {
            'title' : self.title,
            'roots' : {
                'root_ids' : root_ids,
                'references' : references_json(root_references)
            },
            'version' : __version__
        }

        return serialize_json(json, indent=indent)