tatara 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +17 -1
- data/.gitignore +1 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +0 -2
- data/Makefile +11 -73
- data/README.md +2 -1
- data/docs/tatara/float_array.md +65 -0
- data/docs/tatara/float_vector.md +64 -0
- data/docs/tatara/integer_array.md +64 -0
- data/docs/tatara/integer_vector.md +64 -0
- data/docs/tatara/string_array.md +64 -0
- data/docs/tatara/string_vector.md +64 -0
- data/ext/tatara/array/array.hpp +5 -119
- data/ext/tatara/array/float/float_array.hpp +132 -0
- data/ext/tatara/array/integer/int_array.hpp +132 -0
- data/ext/tatara/array/string/string_array.hpp +133 -0
- data/ext/tatara/extconf.rb +1 -1
- data/ext/tatara/float/float.hpp +148 -0
- data/ext/tatara/integer/integer.hpp +164 -0
- data/ext/tatara/map/float/float_float_map.hpp +66 -0
- data/ext/tatara/map/float/float_int_map.hpp +66 -0
- data/ext/tatara/map/float/float_string_map.hpp +67 -0
- data/ext/tatara/map/integer/int_float_map.hpp +66 -0
- data/ext/tatara/map/integer/int_int_map.hpp +66 -0
- data/ext/tatara/map/integer/int_string_map.hpp +67 -0
- data/ext/tatara/map/map.hpp +14 -27
- data/ext/tatara/map/string/string_float_map.hpp +67 -0
- data/ext/tatara/map/string/string_int_map.hpp +67 -0
- data/ext/tatara/map/string/string_string_map.hpp +67 -0
- data/ext/tatara/string/string.hpp +105 -0
- data/ext/tatara/tatara.cpp +245 -244
- data/ext/tatara/vector/float/float_vector.hpp +132 -0
- data/ext/tatara/vector/integer/int_vector.hpp +132 -0
- data/ext/tatara/vector/string/string_vector.hpp +133 -0
- data/ext/tatara/vector/vector.hpp +4 -0
- data/lib/tatara/array/array.rb +73 -0
- data/lib/tatara/vector/vector.rb +77 -0
- data/lib/tatara/version.rb +1 -1
- data/tatara.gemspec +1 -0
- metadata +31 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d6932eb100195cd4f6c8f5043859236e73e46f25a31653f602bcbb89ba37960
|
4
|
+
data.tar.gz: c260336b4634a873cd2916f4dcf941c781240677e69faa81554df1acd19d6bb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0da08fbf1849854e20b7c33dcb60487885eed313b8bc446b50a9c20f924ee88d32739e8cc72c6c1da279548ee5ba7da82219b79abf69b30811fc0134deeb0f0
|
7
|
+
data.tar.gz: 931c989d75f9bf306e808e3327e8bffd876e4b569f24452ebde3310791c87d86b0ce86ee7d51081d99e806c7de90a3a5a9f5c06ec3acf2eba23daabf2f4c68c5
|
data/.circleci/config.yml
CHANGED
@@ -3,9 +3,17 @@ jobs:
|
|
3
3
|
build:
|
4
4
|
docker:
|
5
5
|
- image: circleci/ruby:2.6.5
|
6
|
+
environment:
|
7
|
+
CC_TEST_REPORTER_ID: '1bc997946c470551ec0f384e37c5646f12d924d9ab98251809a7d6baf5154445'
|
6
8
|
steps:
|
7
9
|
- checkout
|
8
10
|
|
11
|
+
- run:
|
12
|
+
name: Setup Code Climate test-reporter
|
13
|
+
command: |
|
14
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
15
|
+
chmod +x ./cc-test-reporter
|
16
|
+
|
9
17
|
- run:
|
10
18
|
name: install bundler
|
11
19
|
command: gem install bundler
|
@@ -18,6 +26,14 @@ jobs:
|
|
18
26
|
name: compile
|
19
27
|
command: rake compile
|
20
28
|
|
29
|
+
- run:
|
30
|
+
name: before-build
|
31
|
+
command: ./cc-test-reporter before-build
|
32
|
+
|
21
33
|
- run:
|
22
34
|
name: test
|
23
|
-
command: rake test
|
35
|
+
command: rake test
|
36
|
+
|
37
|
+
- run:
|
38
|
+
name: after-build
|
39
|
+
command: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/Makefile
CHANGED
@@ -12,109 +12,65 @@ NULLCMD = :
|
|
12
12
|
#### Start of system configuration section. ####
|
13
13
|
|
14
14
|
srcdir = ext/tatara
|
15
|
-
topdir = /home/sh/.rbenv/versions/2.6.
|
15
|
+
topdir = /home/sh/.rbenv/versions/2.6.5/include/ruby-2.6.0
|
16
16
|
hdrdir = $(topdir)
|
17
|
-
arch_hdrdir = /home/sh/.rbenv/versions/2.6.
|
17
|
+
arch_hdrdir = /home/sh/.rbenv/versions/2.6.5/include/ruby-2.6.0/x86_64-linux
|
18
18
|
PATH_SEPARATOR = :
|
19
19
|
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
20
|
-
|
21
|
-
prefix = $(DESTDIR)/home/sh/.rbenv/versions/2.6.3
|
22
|
-
|
20
|
+
prefix = $(DESTDIR)/home/sh/.rbenv/versions/2.6.5
|
23
21
|
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
24
|
-
|
25
22
|
rubyarchprefix = $(rubylibprefix)/$(arch)
|
26
|
-
|
27
23
|
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
28
|
-
|
29
24
|
exec_prefix = $(prefix)
|
30
|
-
|
31
25
|
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
|
32
|
-
|
33
26
|
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
|
34
|
-
|
35
27
|
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
|
36
|
-
|
37
28
|
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
38
|
-
|
39
29
|
sitehdrdir = $(rubyhdrdir)/site_ruby
|
40
|
-
|
41
30
|
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
|
42
|
-
|
43
31
|
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
44
|
-
|
45
32
|
vendorlibdir = $(vendordir)/$(ruby_version)
|
46
|
-
|
47
33
|
vendordir = $(rubylibprefix)/vendor_ruby
|
48
|
-
|
49
34
|
sitearchdir = $(sitelibdir)/$(sitearch)
|
50
|
-
|
51
35
|
sitelibdir = $(sitedir)/$(ruby_version)
|
52
|
-
|
53
36
|
sitedir = $(rubylibprefix)/site_ruby
|
54
|
-
|
55
37
|
rubyarchdir = $(rubylibdir)/$(arch)
|
56
|
-
|
57
38
|
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
58
|
-
|
59
39
|
sitearchincludedir = $(includedir)/$(sitearch)
|
60
|
-
|
61
40
|
archincludedir = $(includedir)/$(arch)
|
62
|
-
|
63
41
|
sitearchlibdir = $(libdir)/$(sitearch)
|
64
|
-
|
65
42
|
archlibdir = $(libdir)/$(arch)
|
66
|
-
|
67
43
|
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
68
|
-
|
69
44
|
mandir = $(datarootdir)/man
|
70
|
-
|
71
45
|
localedir = $(datarootdir)/locale
|
72
|
-
|
73
46
|
libdir = $(exec_prefix)/lib
|
74
|
-
|
75
47
|
psdir = $(docdir)
|
76
|
-
|
77
48
|
pdfdir = $(docdir)
|
78
|
-
|
79
49
|
dvidir = $(docdir)
|
80
|
-
|
81
50
|
htmldir = $(docdir)
|
82
|
-
|
83
51
|
infodir = $(datarootdir)/info
|
84
|
-
|
85
52
|
docdir = $(datarootdir)/doc/$(PACKAGE)
|
86
|
-
|
87
53
|
oldincludedir = $(DESTDIR)/usr/include
|
88
|
-
|
89
54
|
includedir = $(prefix)/include
|
90
|
-
|
55
|
+
runstatedir = $(localstatedir)/run
|
91
56
|
localstatedir = $(prefix)/var
|
92
|
-
|
93
57
|
sharedstatedir = $(prefix)/com
|
94
|
-
|
95
58
|
sysconfdir = $(prefix)/etc
|
96
|
-
|
97
59
|
datadir = $(datarootdir)
|
98
|
-
|
99
60
|
datarootdir = $(prefix)/share
|
100
|
-
|
101
61
|
libexecdir = $(exec_prefix)/libexec
|
102
|
-
|
103
62
|
sbindir = $(exec_prefix)/sbin
|
104
|
-
|
105
63
|
bindir = $(exec_prefix)/bin
|
106
|
-
|
107
64
|
archdir = $(rubyarchdir)
|
108
65
|
|
109
66
|
|
110
|
-
|
111
67
|
CC_WRAPPER =
|
112
68
|
CC = gcc
|
113
69
|
CXX = g++
|
114
70
|
LIBRUBY = $(LIBRUBY_SO)
|
115
71
|
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
116
72
|
LIBRUBYARG_SHARED = -Wl,-rpath,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)
|
117
|
-
LIBRUBYARG_STATIC = -Wl,-rpath
|
73
|
+
LIBRUBYARG_STATIC = -Wl,-rpath,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static $(MAINLIBS)
|
118
74
|
empty =
|
119
75
|
OUTFLAG = -o $(empty)
|
120
76
|
COUTFLAG = -o $(empty)
|
@@ -131,31 +87,24 @@ CCDLFLAGS = -fPIC
|
|
131
87
|
CFLAGS = $(CCDLFLAGS) $(cflags) -fPIC $(ARCH_FLAG)
|
132
88
|
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
133
89
|
DEFS =
|
134
|
-
CPPFLAGS = -I/home/sh/.rbenv/versions/2.6.
|
135
|
-
CXXFLAGS = $(
|
136
|
-
ldflags = -L. -L/home/sh/.rbenv/versions/2.6.
|
137
|
-
dldflags = -L/home/sh/.rbenv/versions/2.6.
|
90
|
+
CPPFLAGS = -I/home/sh/.rbenv/versions/2.6.5/include $(DEFS) $(cppflags)
|
91
|
+
CXXFLAGS = $(CCDLFLAGS) -Ofast -mtune=native -march=native -mfpmath=both -std=c++17 $(ARCH_FLAG)
|
92
|
+
ldflags = -L. -L/home/sh/.rbenv/versions/2.6.5/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic
|
93
|
+
dldflags = -L/home/sh/.rbenv/versions/2.6.5/lib -Wl,--compress-debug-sections=zlib
|
138
94
|
ARCH_FLAG =
|
139
95
|
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
140
|
-
LDSHARED =
|
96
|
+
LDSHARED = $(CC) -shared
|
141
97
|
LDSHAREDXX = $(CXX) -shared
|
142
98
|
AR = ar
|
143
99
|
EXEEXT =
|
144
100
|
|
145
|
-
|
146
101
|
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
147
|
-
|
148
102
|
RUBY_SO_NAME = ruby
|
149
|
-
|
150
103
|
RUBYW_INSTALL_NAME =
|
151
|
-
|
152
104
|
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
153
|
-
|
154
105
|
RUBYW_BASE_NAME = rubyw
|
155
|
-
|
156
106
|
RUBY_BASE_NAME = ruby
|
157
107
|
|
158
|
-
|
159
108
|
arch = x86_64-linux
|
160
109
|
sitearch = $(arch)
|
161
110
|
ruby_version = 2.6.0
|
@@ -176,9 +125,6 @@ TOUCH = exit >
|
|
176
125
|
#### End of system configuration section. ####
|
177
126
|
|
178
127
|
preload =
|
179
|
-
|
180
|
-
|
181
|
-
CXX = g++
|
182
128
|
libpath = . $(libdir)
|
183
129
|
LIBPATH = -L. -L$(libdir) -Wl,-rpath,$(libdir)
|
184
130
|
DEFFILE =
|
@@ -191,7 +137,7 @@ extout =
|
|
191
137
|
extout_prefix =
|
192
138
|
target_prefix = /tatara
|
193
139
|
LOCAL_LIBS =
|
194
|
-
LIBS = -
|
140
|
+
LIBS = $(LIBRUBYARG_SHARED) -lm -lc
|
195
141
|
ORIG_SRCS = tatara.cpp
|
196
142
|
SRCS = $(ORIG_SRCS)
|
197
143
|
OBJS = tatara.o
|
@@ -205,25 +151,17 @@ EXTSTATIC =
|
|
205
151
|
STATIC_LIB =
|
206
152
|
|
207
153
|
TIMESTAMP_DIR = .
|
208
|
-
|
209
154
|
BINDIR = $(bindir)
|
210
|
-
|
211
155
|
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
212
|
-
|
213
156
|
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
214
|
-
|
215
157
|
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
216
|
-
|
217
158
|
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
218
|
-
|
219
159
|
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
220
|
-
|
221
160
|
TARGET_SO_DIR =
|
222
161
|
TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
|
223
162
|
CLEANLIBS = $(TARGET_SO)
|
224
163
|
CLEANOBJS = *.o *.bak
|
225
164
|
|
226
|
-
|
227
165
|
all: $(DLLIB)
|
228
166
|
static: $(STATIC_LIB)
|
229
167
|
.PHONY: all install static install-so install-rb
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# Tatara
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/tatara.svg)](https://badge.fury.io/rb/tatara) [![CircleCI](https://circleci.com/gh/S-H-GAMELINKS/tatara/tree/master.svg?style=svg)](https://circleci.com/gh/S-H-GAMELINKS/tatara/tree/master) [![Test Coverage](https://api.codeclimate.com/v1/badges/0a4d91d453ab2466e2bc/test_coverage)](https://codeclimate.com/github/S-H-GAMELINKS/tatara/test_coverage) ![star](https://img.shields.io/github/stars/S-H-GAMELINKS/tatara) ![forks](https://img.shields.io/github/forks/S-H-GAMELINKS/tatara) ![license](https://img.shields.io/github/license/S-H-GAMELINKS/tatara) [![Maintainability](https://api.codeclimate.com/v1/badges/0a4d91d453ab2466e2bc/maintainability)](https://codeclimate.com/github/S-H-GAMELINKS/tatara/maintainability)
|
2
3
|
|
3
4
|
Add Type to Ruby!
|
4
5
|
|
@@ -42,4 +43,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
42
43
|
|
43
44
|
## Contributing
|
44
45
|
|
45
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
46
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/S-H-GAMELINKS/tatara.
|
data/docs/tatara/float_array.md
CHANGED
@@ -231,6 +231,59 @@ Reverse value's.
|
|
231
231
|
# => [4.0, 1.0, 9.0]
|
232
232
|
```
|
233
233
|
|
234
|
+
### Tatara::FloatArray#uniq
|
235
|
+
|
236
|
+
Remove duplicate in `Tatara::FloatArray`.
|
237
|
+
|
238
|
+
```ruby
|
239
|
+
@f = Tatara::FloatArray.new
|
240
|
+
[1, 3, 4, 1].each{|f| @f << f.to_f}
|
241
|
+
@f = @f.uniq
|
242
|
+
# => Remove duplicate!
|
243
|
+
@f.each{|f| puts f }
|
244
|
+
# => 1.0, 3.0, 4.0
|
245
|
+
```
|
246
|
+
|
247
|
+
|
248
|
+
### Tatara::FloatArray#uniq!
|
249
|
+
|
250
|
+
Remove destructive duplicate in `Tatara::FloatArray`.
|
251
|
+
|
252
|
+
```ruby
|
253
|
+
@f = Tatara::FloatArray.new
|
254
|
+
[1, 3, 4, 1].each{|f| @f << f.to_f}
|
255
|
+
@f.uniq!
|
256
|
+
# => Remove duplicate!
|
257
|
+
@f.each{|f| puts f }
|
258
|
+
# => 1.0, 3.0, 4.0
|
259
|
+
```
|
260
|
+
|
261
|
+
### Tatara::FloatArray#slice
|
262
|
+
|
263
|
+
Slice value's' in `Tatara::FloatArray`.
|
264
|
+
|
265
|
+
```ruby
|
266
|
+
@f = Tatara::FloatArray.new
|
267
|
+
[1, 2, 3, 4, 5].each{|f| @f << f.to_f}
|
268
|
+
@f = @f.slice(1, 3)
|
269
|
+
# => Slice value
|
270
|
+
@f.each{|f| puts f }
|
271
|
+
# => 2.0, 3.0, 4.0
|
272
|
+
```
|
273
|
+
|
274
|
+
### Tatara::FloatArray#slice!
|
275
|
+
|
276
|
+
Destructive Slice value's' in `Tatara::FloatArray`.
|
277
|
+
|
278
|
+
```ruby
|
279
|
+
@f = Tatara::FloatArray.new
|
280
|
+
[1, 2, 3, 4, 5].each{|f| @f << f.to_f}
|
281
|
+
@f.slice!(1, 3)
|
282
|
+
# => Slice value
|
283
|
+
@f.each{|f| puts f }
|
284
|
+
# => 2.0, 3.0, 4.0
|
285
|
+
```
|
286
|
+
|
234
287
|
### Tatara::FloatArray#first
|
235
288
|
|
236
289
|
Get first value of `Tatara::FloatArray`.
|
@@ -253,4 +306,16 @@ Get last value of `Tatara::FloatArray`.
|
|
253
306
|
# => Set new value's
|
254
307
|
puts @f.last
|
255
308
|
# => 3.0
|
309
|
+
```
|
310
|
+
|
311
|
+
### Tatara::FloatArray#to_array
|
312
|
+
|
313
|
+
Convert to `Array` from `Tatara::FloatArray`.
|
314
|
+
|
315
|
+
```ruby
|
316
|
+
@f = Tatara::FloatArray.new
|
317
|
+
(1..3).each{|f| @f << f.to_f }
|
318
|
+
# => Set new value's
|
319
|
+
puts @f.to_array
|
320
|
+
# => 1.0, 2.0, 3.0
|
256
321
|
```
|
data/docs/tatara/float_vector.md
CHANGED
@@ -244,6 +244,58 @@ Reverse value's.
|
|
244
244
|
# => [4.0, 1.0, 9.0]
|
245
245
|
```
|
246
246
|
|
247
|
+
### Tatara::FloatVector#uniq
|
248
|
+
|
249
|
+
Remove duplicate in `Tatara::FloatVector`.
|
250
|
+
|
251
|
+
```ruby
|
252
|
+
@f = Tatara::FloatVector.new
|
253
|
+
[1, 3, 4, 1].each{|f| @f << f.to_f}
|
254
|
+
@f = @f.uniq
|
255
|
+
# => Remove duplicate!
|
256
|
+
@f.each{|f| puts f }
|
257
|
+
# => 1.0, 3.0, 4.0
|
258
|
+
```
|
259
|
+
|
260
|
+
### Tatara::FloatVector#uniq!
|
261
|
+
|
262
|
+
Remove destructive duplicate in `Tatara::FloatVector`.
|
263
|
+
|
264
|
+
```ruby
|
265
|
+
@f = Tatara::FloatVector.new
|
266
|
+
[1, 3, 4, 1].each{|f| @f << f.to_f}
|
267
|
+
@f.uniq!
|
268
|
+
# => Remove duplicate!
|
269
|
+
@f.each{|f| puts f }
|
270
|
+
# => 1.0, 3.0, 4.0
|
271
|
+
```
|
272
|
+
|
273
|
+
### Tatara::FloatVector#slice
|
274
|
+
|
275
|
+
Slice value's' in `Tatara::FloatVector`.
|
276
|
+
|
277
|
+
```ruby
|
278
|
+
@f = Tatara::FloatVector.new
|
279
|
+
[1, 2, 3, 4, 5].each{|f| @f << f.to_f}
|
280
|
+
@f = @f.slice(1, 3)
|
281
|
+
# => Slice value
|
282
|
+
@f.each{|f| puts f }
|
283
|
+
# => 2.0, 3.0, 4.0
|
284
|
+
```
|
285
|
+
|
286
|
+
### Tatara::FloatVector#slice!
|
287
|
+
|
288
|
+
Destructive Slice value's' in `Tatara::FloatVector`.
|
289
|
+
|
290
|
+
```ruby
|
291
|
+
@f = Tatara::FloatVector.new
|
292
|
+
[1, 2, 3, 4, 5].each{|f| @f << f.to_f}
|
293
|
+
@f.slice!(1, 3)
|
294
|
+
# => Slice value
|
295
|
+
@f.each{|f| puts f }
|
296
|
+
# => 2.0, 3.0, 4.0
|
297
|
+
```
|
298
|
+
|
247
299
|
### Tatara::FloatVector#first
|
248
300
|
|
249
301
|
Get first value of `Tatara::FloatVector`.
|
@@ -266,4 +318,16 @@ Get last value of `Tatara::FloatVector`.
|
|
266
318
|
# => Set new value's
|
267
319
|
puts @f.last
|
268
320
|
# => 3.0
|
321
|
+
```
|
322
|
+
|
323
|
+
### Tatara::FloatVector#to_array
|
324
|
+
|
325
|
+
Convert to `Array` from `Tatara::FloatVector`.
|
326
|
+
|
327
|
+
```ruby
|
328
|
+
@f = Tatara::FloatVector.new
|
329
|
+
(1..3).each{|f| @f << f.to_f }
|
330
|
+
# => Set new value's
|
331
|
+
puts @f.to_array
|
332
|
+
# => 1.0, 2.0, 3.0
|
269
333
|
```
|
@@ -231,6 +231,58 @@ Reverse value's.
|
|
231
231
|
# => [4, 1, 9]
|
232
232
|
```
|
233
233
|
|
234
|
+
### Tatara::IntArray#uniq
|
235
|
+
|
236
|
+
Remove duplicate in `Tatara::IntArray`.
|
237
|
+
|
238
|
+
```ruby
|
239
|
+
@i = Tatara::IntArray.new
|
240
|
+
[1, 3, 4, 1].each{|i| @i << i}
|
241
|
+
@i = @i.uniq
|
242
|
+
# => Remove duplicate!
|
243
|
+
@i.each{|i| puts i }
|
244
|
+
# => 1, 3, 4
|
245
|
+
```
|
246
|
+
|
247
|
+
### Tatara::IntArray#uniq!
|
248
|
+
|
249
|
+
Remove destructive duplicate in `Tatara::IntArray`.
|
250
|
+
|
251
|
+
```ruby
|
252
|
+
@i = Tatara::IntArray.new
|
253
|
+
[1, 3, 4, 1].each{|i| @i << i}
|
254
|
+
@i.uniq!
|
255
|
+
# => Remove duplicate!
|
256
|
+
@i.each{|i| puts i }
|
257
|
+
# => 1, 3, 4
|
258
|
+
```
|
259
|
+
|
260
|
+
### Tatara::IntArray#slice
|
261
|
+
|
262
|
+
Slice value's' in `Tatara::IntArray`.
|
263
|
+
|
264
|
+
```ruby
|
265
|
+
@i = Tatara::IntArray.new
|
266
|
+
[1, 2, 3, 4, 5].each{|i| @i << i}
|
267
|
+
@i = @i.slice(1, 3)
|
268
|
+
# => Slice value
|
269
|
+
@i.each{|i| puts i }
|
270
|
+
# => 2, 3, 4
|
271
|
+
```
|
272
|
+
|
273
|
+
### Tatara::IntArray#slice!
|
274
|
+
|
275
|
+
Destructive Slice value's' in `Tatara::IntArray`.
|
276
|
+
|
277
|
+
```ruby
|
278
|
+
@i = Tatara::IntArray.new
|
279
|
+
[1, 2, 3, 4, 5].each{|i| @i << i}
|
280
|
+
@i.slice!(1, 3)
|
281
|
+
# => Slice value
|
282
|
+
@i.each{|i| puts i }
|
283
|
+
# => 2, 3, 4
|
284
|
+
```
|
285
|
+
|
234
286
|
### Tatara::IntArray#first
|
235
287
|
|
236
288
|
Get first value of `Tatara::IntArray`.
|
@@ -253,4 +305,16 @@ Get last value of `Tatara::IntArray`.
|
|
253
305
|
# => Set new value's
|
254
306
|
puts @i.last
|
255
307
|
# => 3
|
308
|
+
```
|
309
|
+
|
310
|
+
### Tatara::IntArray#to_array
|
311
|
+
|
312
|
+
Convert to `Array` from `Tatara::IntArray`.
|
313
|
+
|
314
|
+
```ruby
|
315
|
+
@i = Tatara::IntArray.new
|
316
|
+
(1..3).each{|i| @i << i }
|
317
|
+
# => Set new value's
|
318
|
+
puts @i.to_array
|
319
|
+
# => 1, 2, 3
|
256
320
|
```
|