lib/vedeu/cursor/cursor.rb in vedeu-0.4.1 vs lib/vedeu/cursor/cursor.rb in vedeu-0.4.2

- old
+ new

@@ -1,8 +1,8 @@ require 'vedeu/cursor/all' require 'vedeu/models/model' -require 'vedeu/support/position' +require 'vedeu/geometry/position' require 'vedeu/support/visible' module Vedeu # Each interface has its own Cursor which maintains the position and @@ -39,27 +39,20 @@ # name. if attributes.is_a?(String) attributes = { name: attributes } end - @attributes = defaults.merge(attributes) + @attributes = defaults.merge!(attributes) @name = @attributes.fetch(:name) @ox = @attributes.fetch(:ox) @oy = @attributes.fetch(:oy) @repository = @attributes.fetch(:repository) @state = Vedeu::Visible.coerce(@attributes.fetch(:state)) @x = @attributes.fetch(:x) @y = @attributes.fetch(:y) @position = Vedeu::Position.new(@y, @x) - end - - # Returns log friendly output. - # - # @return [String] - def inspect - "<#{self.class.name} (#{@name}: x:#{@x} y:#{@y} ox:#{@ox} oy:#{@oy})>" end # Returns an escape sequence to position the cursor and set its visibility. # When passed a block, will position the cursor, yield and return the # original position.