mutability 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d50c6fccc937e64c9aacd581c09292f5c8a207c6
4
- data.tar.gz: d92c70521b1015d9872e5ab0127a502787c47d47
3
+ metadata.gz: 5c7663bdaa2bd8eeb4b329a2c681a73cceb7b4c1
4
+ data.tar.gz: f4cea2ace18a6f944c4ce6109d1bd22c39ff2f6b
5
5
  SHA512:
6
- metadata.gz: 422584f7d3702d4049213d370e6ab022f81f44a28d3a71e9ffdd1153f9c50716296ea9cc12ebd2d97fce91f3481b6805638bfd0131d0d65a2624bdc21659ad4b
7
- data.tar.gz: ccbbccd58187edfd755173980f8a0a66753d1f18470bca230a30146fd708b3fd6c9c180bcd338ace5c50271a38bff8947e8cc77274272d2fdd7c48da9f64de1c
6
+ metadata.gz: 0d43d273156ef40dc41fe166205311364d98d2251bba39b5a34f909b7cb33bbd4e89876ca45b584c78ee569cccffbe0c8761b4f89b7b62494ebd80dc136b60bc
7
+ data.tar.gz: 54b4d6ec06c4852ecd49071a4365b7594f262018c65362d9e6bd066e11053f52a1031c8d12bbbe8c7de59b69d4dbd250a09b1138715b18417adbfc4a20d841aa
@@ -38,6 +38,10 @@ module Mutability
38
38
  @self = @original.dup # we want an unfrozen copy, so cannot clone
39
39
  end
40
40
 
41
+ def respond_to?(method)
42
+ super || @self.respond_to?(method)
43
+ end
44
+
41
45
  private
42
46
 
43
47
  # cheap delegation
@@ -2,8 +2,8 @@ require_relative 'mutable'
2
2
 
3
3
  module Mutability
4
4
  class MutableArray < Mutable
5
- def initialize(array = [])
6
- super array
5
+ def initialize(*array)
6
+ super array.flatten # allow either .new(1,2,3) or .new([1,2,3])
7
7
  end
8
8
  end
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module Mutability
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutability
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelli Searfos