Last change
on this file since 2f8d6d8 was
6b3be72,
checked in by pawelk <pawelk@…>, 17 years ago
|
Pierwsza przymiarka do umieszczenia plikow w ~/.local/utt. Obsługa nowych opcji domyslnych. Nieskonczona dystrybucja tarball.
git-svn-id: svn://atos.wmid.amu.edu.pl/utt@41 e293616e-ec6a-49c2-aa92-f4a8b91c5d16
|
-
Property mode set to
100644
|
File size:
343 bytes
|
Line | |
---|
1 | |
---|
2 | class Seg |
---|
3 | |
---|
4 | def initialize(s="") |
---|
5 | @line=s |
---|
6 | self |
---|
7 | end |
---|
8 | |
---|
9 | def to_s |
---|
10 | @line.chomp |
---|
11 | end |
---|
12 | |
---|
13 | def set(s) |
---|
14 | @line=s |
---|
15 | self |
---|
16 | end |
---|
17 | |
---|
18 | def field(key) |
---|
19 | if key.class==Fixnum |
---|
20 | @line.split[key-1] |
---|
21 | elsif key.class==String |
---|
22 | @line =~ /\s#{key}:(\S+)/; $1 |
---|
23 | end |
---|
24 | end |
---|
25 | alias [] field |
---|
26 | |
---|
27 | def fields |
---|
28 | @line.split |
---|
29 | end |
---|
30 | |
---|
31 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.