Module: RIO::Cp::Util::InOut

Included in:
Input, Output
Defined in:
lib/rio/cp.rb

Instance Method Summary collapse

Instance Method Details

#cpclose(*args, &block) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/rio/cp.rb', line 50

def cpclose(*args,&block)
  if args.empty?
    oldcoc = self.cx.get_keystate('closeoncopy')
    self.cx['closeoncopy'] = false
    rtn = yield
    rtn.cx.set_keystate(*oldcoc)
    rtn.copyclose
  else
    if (ario = args[0]).kind_of?(Rio)
      oldcoc = ario.cx.get_keystate('closeoncopy')
      ario.cx['closeoncopy'] = false
      rtn = yield
      ario.cx.set_keystate(*oldcoc)
      ario.copyclose
      rtn
    else
      yield
    end
  end
end

#cpclose0(*args, &block) ⇒ Object



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/rio/cp.rb', line 70

def cpclose0(*args,&block)
  if args.empty?
    oldcoc,self.cx['closeoncopy'] = self.cx['closeoncopy'],false
    rtn = yield
    rtn.cx['closeoncopy'] = oldcoc
    rtn.copyclose
  else
    if (ario = args[0]).kind_of?(Rio)
      oldcoc,ario.cx['closeoncopy'] = ario.cx['closeoncopy'],false
      rtn = yield
      ario.cx['closeoncopy'] = oldcoc
      ario.copyclose
      rtn
    else
      yield
    end
  end
end