Method: Console#print_at

Defined in:
lib/drydock/console.rb


88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/drydock/console.rb', line 88

def print_at(str, props={})
  print_at_lamb = lambda {
    props[:x] ||= 0
    props[:y] ||= 0
    props[:minus] = false unless props.has_key?(:minus)
    props[:x] = props[:x]-str.noatt.size if props[:x] && props[:minus] # Subtract the str length from the position
    Cursor.save
    Cursor.move = [props[:x], props[:y]]
    print str
    Cursor.restore
  }
  RUBY_VERSION =~ /1.9/ ? Thread.exclusive(&print_at_lamb) : print_at_lamb.call
end