Class: Netrc::TokenArray

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

Instance Method Summary collapse

Instance Method Details

#readtoObject



76
77
78
79
80
81
82
# File 'lib/netrc.rb', line 76

def readto
  l = []
  while length > 0 && ! yield(self[0])
    l << shift
  end
  return l.join
end

#takeObject



69
70
71
72
73
74
# File 'lib/netrc.rb', line 69

def take
  if length < 1
    raise Error, "unexpected EOF"
  end
  shift
end