lib/data_frame.rb in davidrichards-data_frame-0.0.7 vs lib/data_frame.rb in davidrichards-data_frame-0.0.8
- old
+ new
@@ -75,10 +75,11 @@
end
def add_item(item)
self.items << item
end
+ alias :add :add_item
def row_labels
@row_labels ||= []
end
@@ -107,8 +108,18 @@
elsif @items.respond_to?(sym)
@items.send(sym, *args, &block)
else
super
end
+ end
+
+ def drop!(label)
+ i = self.labels.index(label)
+ return nil unless i
+ self.items.each do |item|
+ item.delete_at(i)
+ end
+ self.labels.delete_at(i)
+ true
end
end
\ No newline at end of file