omf_oml 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/omf_oml/table.rb +16 -10
- data/lib/omf_oml/version.rb +1 -1
- metadata +2 -2
data/lib/omf_oml/table.rb
CHANGED
@@ -131,6 +131,21 @@ module OMF::OML
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
+
# Remove all rows from table.
|
135
|
+
#
|
136
|
+
# NOTE: +on_row_removed+ callbacks are done within the monitor.
|
137
|
+
#
|
138
|
+
def clear()
|
139
|
+
synchronize do
|
140
|
+
return if @rows.empty?
|
141
|
+
old = @rows
|
142
|
+
@rows = []
|
143
|
+
#@row_id = 0 # Should we rest that as well??
|
144
|
+
_notify_content_changed(:removed, old)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
|
134
149
|
def <<(row)
|
135
150
|
add_row(row)
|
136
151
|
end
|
@@ -234,10 +249,6 @@ module OMF::OML
|
|
234
249
|
unless row.length == @col_count
|
235
250
|
raise "Unexpected col count for row '#{row}' - schema: #{@schema}"
|
236
251
|
end
|
237
|
-
# if @indexed_rows
|
238
|
-
# @indexed_rows[row[@index_col]] = row
|
239
|
-
# return
|
240
|
-
# end
|
241
252
|
|
242
253
|
@rows << row
|
243
254
|
if @max_size && @max_size > 0 && (s = @rows.size) > @max_size
|
@@ -251,12 +262,7 @@ module OMF::OML
|
|
251
262
|
|
252
263
|
def _notify_content_changed(action, rows)
|
253
264
|
@on_content_changed.each_value do |proc|
|
254
|
-
|
255
|
-
#if proc.arity == 1
|
256
|
-
proc.call(action, rows)
|
257
|
-
#else
|
258
|
-
#proc.call(row, @offset)
|
259
|
-
#end
|
265
|
+
proc.call(action, rows)
|
260
266
|
end
|
261
267
|
end
|
262
268
|
|
data/lib/omf_oml/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omf_oml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-07-
|
12
|
+
date: 2014-07-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omf_base
|