projects
/
chise
/
ruby.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update.
[chise/ruby.git]
/
chise
/
string.rb
diff --git
a/chise/string.rb
b/chise/string.rb
index
929c7ca
..
7569db0
100755
(executable)
--- a/
chise/string.rb
+++ b/
chise/string.rb
@@
-2,8
+2,11
@@
require "chise/character"
require "chise/parser"
require "chise/character"
require "chise/parser"
+require "chise/ids"
class String
class String
+ include CHISE::StringIDS
+
# copied from htree/encoder.rb
UTF8_RE = /\A(?:
[\x00-\x7f]
# copied from htree/encoder.rb
UTF8_RE = /\A(?:
[\x00-\x7f]
@@
-22,8
+25,9
@@
class String
CHISE::Character.get("?"+self)
end
CHISE::Character.get("?"+self)
end
- def method_missing(mid, *args)
- char.method_missing(mid, *args)
+ def method_missing(mid, *args, &block)
+ #char.method_missing(mid, *args)
+ char.send(mid, *args, &block)
end
def to_a
end
def to_a
@@
-40,6
+44,12
@@
class String
}
end
}
end
+ def map_char
+ to_a.map {|c|
+ yield(c).to_s
+ }.join
+ end
+
def each_character
to_a.each {|ch|
yield ch.char
def each_character
to_a.each {|ch|
yield ch.char
@@
-51,4
+61,8
@@
class String
pa.de_er(self)
end
pa.de_er(self)
end
+ def to_ids
+ CHISE::IDS.new(self)
+ end
+
end
end