fixed-array 1.0.0

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. checksums.yaml +7 -0
  2. data/lib/fixed_array.rb +32 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f92c9de4e68ce65761a373c0d33d6df868048907bbd6af7134d38de0a62cba35
4
+ data.tar.gz: 7d9d82660a4db0f96b406034f1dd228d6b65eb0f7a2c050938da670cb237bea5
5
+ SHA512:
6
+ metadata.gz: e7379bdeeaed82609fd9d376225c6ab0c5ef6bdb00cde34161aa51e1bb77222f8dffa3243a1641148f7ce25ea96de74f691a8dc07a234bea1784d7ff3f4952f4
7
+ data.tar.gz: ddbd2bab137a2a1daab33e376bff6da47b04106638be0b81ae621839a7b5d88c6297dac2c7e5ca0eedc2fc0d017065b31552d08b0dc045da0eb4c8ba3e81d03e
@@ -0,0 +1,32 @@
1
+ class Array
2
+ def to_fixed_a
3
+ FixedArray.new(size){ |i| self[i] }
4
+ end
5
+ end
6
+
7
+ class FixedArray < Array
8
+ VERSION = '1.0.0'
9
+
10
+ undef_method :<<
11
+ undef_method :append
12
+ undef_method :clear
13
+ undef_method :compact!
14
+ undef_method :concat
15
+ undef_method :delete
16
+ undef_method :delete_if
17
+ undef_method :fill
18
+ undef_method :select!
19
+ undef_method :reject!
20
+ undef_method :flatten!
21
+ undef_method :replace
22
+ undef_method :insert
23
+ undef_method :keep_if
24
+ undef_method :pop
25
+ undef_method :prepend
26
+ undef_method :unshift
27
+ undef_method :push
28
+ undef_method :shift
29
+ undef_method :slice!
30
+ undef_method :transpose
31
+ undef_method :uniq!
32
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fixed-array
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - questionmarkexclamationpoint
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-06-26 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Adds a class, FixedArray, that extends Array, which removes all methods
14
+ which can alter the size of the array.
15
+ email:
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/fixed_array.rb
21
+ homepage: https://github.com/questionmarkexclamationpoint/fixed-array
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.3.16
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Fixed size array
44
+ test_files: []