Sha256: a2ff0707d8d81251f819002403a3efa71bc5606686495b43480e08d06c8f51e8

Contents?: true

Size: 693 Bytes

Versions: 4

Compression:

Stored size: 693 Bytes

Contents

module Glimmer
  module Tk
    DragAndDropEvent = Struct.new(:source, :target, :tooltip, :x_root, :y_root, :data, :drop_accepted) do
      alias drop_accepted? drop_accepted
      
      def as_json(*)
        klass = self.class.name
        {
          JSON.create_id => klass,
          "v" => [values[0].object_id, values[1].object_id, values[2].object_id].concat(values.drop 3),
        }
      end

      def to_json(*args)
        as_json.to_json(*args)
      end

      def self.json_create(object)
        new(*[ObjectSpace._id2ref(object["v"][0]), ObjectSpace._id2ref(object["v"][1]).proxy, ObjectSpace._id2ref(object["v"][2])].concat(object["v"].drop 3))
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
glimmer-dsl-tk-0.0.51 lib/glimmer/tk/drag_and_drop_event.rb
glimmer-dsl-tk-0.0.50 lib/glimmer/tk/drag_and_drop_event.rb
glimmer-dsl-tk-0.0.49 lib/glimmer/tk/drag_and_drop_event.rb
glimmer-dsl-tk-0.0.48 lib/glimmer/tk/drag_and_drop_event.rb