Class: Cliptic::Pos

Inherits:
Object
  • Object
show all
Defined in:
lib/cliptic/lib.rb

Class Method Summary collapse

Class Method Details

.change_dir(dir) ⇒ Object



9
10
11
# File 'lib/cliptic/lib.rb', line 9

def self.change_dir(dir)
  dir == :a ? :d : :a
end

.mk(y, x) ⇒ Object



3
4
5
# File 'lib/cliptic/lib.rb', line 3

def self.mk(y,x)
  { y:y.to_i, x:x.to_i }
end

.wrap(val:, min:, max:) ⇒ Object



6
7
8
# File 'lib/cliptic/lib.rb', line 6

def self.wrap(val:, min:, max:)
  val > max ? min : (val < min ? max : val)
end