arrayfields 4.7.0 → 4.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/arrayfields.rb +7 -3
  2. data/test/arrayfields.rb +1 -0
  3. metadata +2 -2
data/lib/arrayfields.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  # Array#fields= is called
6
6
  #
7
7
  module ArrayFields
8
- self::VERSION = '4.7.0' unless defined? self::VERSION
8
+ self::VERSION = '4.7.1' unless defined? self::VERSION
9
9
  def self.version() VERSION end
10
10
  #
11
11
  # multiton cache of fields - wraps fields and fieldpos map to save memory
@@ -95,6 +95,8 @@
95
95
  if @fieldset and (String === idx or Symbol === idx)
96
96
  pos = @fieldset.pos idx
97
97
  return nil unless pos
98
+ fields.delete_at(pos)
99
+ self.fields = fields
98
100
  super pos
99
101
  else
100
102
  super
@@ -304,13 +306,15 @@
304
306
  #
305
307
  # access to fieldset
306
308
  #
307
- attr_reader :fieldset
309
+ def fieldset
310
+ @fieldset ||= nil
311
+ end
308
312
  #
309
313
  # access to field list
310
314
  #
311
315
  def fields *values
312
316
  return(send('fields=', *values)) unless values.empty?
313
- @fieldset and @fieldset.fields
317
+ fieldset and fieldset.fields
314
318
  end
315
319
  end
316
320
  #
data/test/arrayfields.rb CHANGED
@@ -234,6 +234,7 @@ class ArrayFieldsTest < Test::Unit::TestCase
234
234
  value = @a.delete_at 'three'
235
235
  assert_equal nil, value
236
236
  end
237
+ assert_equal %w(one two), @a.fields
237
238
  #--}}}
238
239
  end
239
240
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arrayfields
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.0
4
+ version: 4.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ara T. Howard
@@ -9,7 +9,7 @@ autorequire: arrayfields
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-01 00:00:00 -07:00
12
+ date: 2009-02-18 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15