diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-12 13:44:58 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-12 13:44:58 +0000 |
commit | 232af9efc706919b271b89824d3d546d208c6b90 (patch) | |
tree | 19e9c0b233bd47450f92b5478ddfdbd81f7c7b88 /lib/csv.rb | |
parent | a9545d8a7edd1d93137b84089584c705567caaee (diff) | |
download | ruby-232af9efc706919b271b89824d3d546d208c6b90.tar.gz ruby-232af9efc706919b271b89824d3d546d208c6b90.tar.xz ruby-232af9efc706919b271b89824d3d546d208c6b90.zip |
* lib/csv.rb: add Cell#to_str and Cell#to_s for /.../ =~ aCell,
"#{aCell}" and so on.
* test/csv/test_csv.rb: add tests.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/csv.rb')
-rw-r--r-- | lib/csv.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/csv.rb b/lib/csv.rb index 10c86f641..cfc5489ea 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -85,6 +85,20 @@ public @data == rhs.data end end + + def to_str + content.to_str + end + + def to_s + content.to_s + end + + private + + def content + @is_null ? nil : data + end end |