Flowdock
method

cell_edited

Importance_0
v1_9_2_180 - Show latest stable - 0 notes - Class: JSONTreeView
cell_edited(cell, path, value) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File ext/json/lib/json/editor.rb, line 755
      def cell_edited(cell, path, value)
        iter = model.get_iter(path)
        case iter.type
        when 'Key'
          unify_key(iter, value)
          toplevel.display_status('Key has been changed.')
        when 'FalseClass'
          value.downcase!
          if value == 'true'
            iter.type, iter.content = 'TrueClass', 'true'
          end
        when 'TrueClass'
          value.downcase!
          if value == 'false'
            iter.type, iter.content = 'FalseClass', 'false'
          end
        when 'Numeric'
          iter.content =
            if value == 'Infinity'
              value
            else
              (Integer(value) rescue Float(value) rescue 0).to_s
            end
        when 'String'
          iter.content = value
        when 'Hash', 'Array'
          return
        else
          fail "Unknown type found in model: #{iter.type}"
        end
        window.change
      end
Register or log in to add new notes.