Sha256: 7cd27d4b492e03bae904fc9306a4bbb172553707e6451448368b80ce2b21b077
Contents?: true
Size: 592 Bytes
Versions: 3
Compression:
Stored size: 592 Bytes
Contents
module Vedeu # Converts a position into an index for the terminal. # class PositionIndex attr_reader :y, :x alias_method :first, :y alias_method :last, :x # @param y [Fixnum] # @param x [Fixnum] # @return [Array] def self.[](y, x) new(y, x).[] end # @param y [Fixnum] # @param x [Fixnum] # @return [Vedeu::PositionIndex] def initialize(y, x) @y = ((y - 1) <= 1) ? 1 : (y - 1) @x = ((x - 1) <= 1) ? 1 : (x - 1) end # @return [Array] def [] [y, x] end end # PositionIndex end # Vedeu
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.4.5 | lib/vedeu/output/position_index.rb |
vedeu-0.4.4 | lib/vedeu/output/position_index.rb |
vedeu-0.4.3 | lib/vedeu/output/position_index.rb |