Skip to content

Commit

Permalink
Added monkey patching CSV::Cell
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Nov 25, 2014
1 parent fe8c063 commit c20d4c2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/util/persistence.rb
Expand Up @@ -10,6 +10,24 @@
class Hash
alias :index :key
end
#another monkey patch for CSV
class CSV
puts "Attention: monkey-patching CSV::Cell"
# deprecated
class Cell < String
@@first = false
def initialize(data = "", is_null = false)
unless @@first
$stderr.puts "Attention: monkey-patching CSV::Cell used by #{caller.join('\n')}"
@@first = true
end
super(is_null ? "" : data)
end
def data
to_s
end
end
end

module ODBA
class Stub
Expand Down

0 comments on commit c20d4c2

Please sign in to comment.