tatara 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: 1268bb136f3184f85b96809e40e4ab571f563bf3fd4642d9addfb80c00ea9302
4
- data.tar.gz: 3ad328e25cefdefbd10cd38cc9b93d98a5da91e402317a77dccb56f9c50d3fb9
3
+ metadata.gz: c964d33173779d12d1d5d9b123868c6bda08d36769fe2ecfeec7465128295edb
4
+ data.tar.gz: 5f3ae65abc2df990f0f7cb47d0c1299887b4e4edd5ff7344082dcec0c989755e
5
5
  SHA512:
6
- metadata.gz: 9f01b88a1ba64c2863f3b927de8ee056c3f33bcdbf2d6a74e77e5ffd7ce16dce7592c109bd7a1b71636f76d62f973ba391b044bc3f8add79ee8984626d181986
7
- data.tar.gz: 8f289f3ac4b1d940e71020683f596470e71a07568de3611033caa017a75ffa54c6f744c83f97aab391cedc3940791a55f9a474df908239943567120ec7d1eeb1
6
+ metadata.gz: 59dddbcc78177d0534e04980ee0e8eb47f8579ab327349e3cf04ed032292320361add3f71d7bd85ed802d7d2750ad1b2f03441afa7cf6347d8bbe119981064ed
7
+ data.tar.gz: 45aac009388ae50963f479094483738a50ee3d9cfd24311702640cd9c0feeaef2779d3b9685fe46b56272a9df49737eeedcbb6a5cc45b84808bf9567a847ea67
@@ -0,0 +1,23 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ docker:
5
+ - image: circleci/ruby:2.6.5
6
+ steps:
7
+ - checkout
8
+
9
+ - run:
10
+ name: install bundler
11
+ command: gem install bundler
12
+
13
+ - run:
14
+ name: install gems
15
+ command: bundle install
16
+
17
+ - run:
18
+ name: compile
19
+ command: rake compile
20
+
21
+ - run:
22
+ name: test
23
+ command: rake test
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tatara (0.1.0)
4
+ tatara (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -26,4 +26,4 @@ DEPENDENCIES
26
26
  tatara!
27
27
 
28
28
  BUNDLED WITH
29
- 2.0.1
29
+ 2.0.2
data/README.md CHANGED
@@ -30,6 +30,10 @@ puts @integer.value # => 42 and type is Integer!
30
30
  `Tatara` supported `Integer`, `Float`, `String`.
31
31
  And, Container for `Vector`, `Array`, `Map`!
32
32
 
33
+ ## Reference
34
+
35
+ [Tatara Reference](https://s-h-gamelinks.github.io/tatara/)
36
+
33
37
  ## Development
34
38
 
35
39
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/docs/_config.yml ADDED
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-dinky
data/docs/index.md ADDED
@@ -0,0 +1,100 @@
1
+ # Tatara
2
+ ## About
3
+
4
+ Tatara is simply Type support gem. Developed by C++/Rice(create Ruby Extension for C++).
5
+
6
+ Provide a simply type & container for your Ruby Code!
7
+
8
+ [View Source in GitHub!](https://github.com/S-H-GAMELINKS/tatara)
9
+
10
+ ## Getting Started
11
+ ### Rails and other Project
12
+ Using Your Project, add `tatara` in your Gemfile.
13
+
14
+ ```ruby:Gemfile
15
+ gem 'tatara'
16
+ ```
17
+
18
+ And run `bundle` command.
19
+
20
+ ```bash
21
+ bundle
22
+ ```
23
+
24
+ So, you can use this code!
25
+
26
+ ```ruby
27
+ require 'tatara'
28
+
29
+ @int_container = Tatara::IntVector.new
30
+
31
+ (1..10).each{|i| @int_container << i}
32
+ # Insert 1..10 to @int_container
33
+
34
+ @int_container.map{|i|
35
+ puts i
36
+ # 1..10 value is shown
37
+ }
38
+ ```
39
+
40
+ ### Install Yourself
41
+
42
+ Run `gem install tatara`.
43
+
44
+ ```bash
45
+ gem install tatara
46
+ ```
47
+
48
+ So, you can use this code!
49
+
50
+ ```ruby
51
+ require 'tatara'
52
+
53
+ @int_container = Tatara::IntVector.new
54
+
55
+ (1..10).each{|i| @int_container << i}
56
+ # Insert 1..10 to @int_container
57
+
58
+ @int_container.map{|i|
59
+ puts i
60
+ # 1..10 value is shown
61
+ }
62
+ ```
63
+
64
+ ## Class List
65
+
66
+ ### [Tatara::Integer](./tatara/integer.md)
67
+
68
+ ### [Tatara::Float](./tatara/float.md)
69
+
70
+ ### [Tatara::String](./tatara/string.md)
71
+
72
+ ### [Tatara::IntVector](./tatara/integer_vector.md)
73
+
74
+ ### [Tatara::FloatVector](./tatara/float_vector.md)
75
+
76
+ ### [Tatara::StringVector](./tatara/string_vector.md)
77
+
78
+ ### [Tatara::IntArray](./tatara/integer_array.md)
79
+
80
+ ### [Tatara::FloatArray](./tatara/float_array.md)
81
+
82
+ ### [Tatara::StringArray](./tatara/string_array.md)
83
+
84
+ ### [Tatara::StringIntMap](./tatara/string_int_map.md)
85
+
86
+ ### [Tatara::StringFloatMap](./tatara/string_float_map.md)
87
+
88
+ ### [Tatara::StringStringMap](./tatara/string_string_map.md)
89
+
90
+ ### [Tatara::IntIntMap](./tatara/integer_integer_map.md)
91
+
92
+ ### [Tatara::IntFloatMap](./tatara/integer_float_map.md)
93
+
94
+ ### [Tatara::IntStringMap](./tatara/integer_string_map.md)
95
+
96
+ ### [Tatara::FloatIntMap](./tatara/float_integer_map.md)
97
+
98
+ ### [Tatara::FloatFloatMap](./tatara/float_float_map.md)
99
+
100
+ ### [Tatara::FloatStringMap](./tatara/float_string_map.md)
@@ -0,0 +1,425 @@
1
+ # Tatara::Float
2
+ ## About
3
+
4
+ `Tatara::Float` is `Float` class like `static type programming lang`.
5
+
6
+ `Tatara::Float` can set `val` for `Float` & `Integer`.
7
+
8
+ ```ruby
9
+ @f = Tatara::Float.new
10
+ @f.val = 1.1
11
+ # => Set 1.1.
12
+ @f.val = 15
13
+ # => Set 15.0.
14
+ ```
15
+
16
+ But, can not set `String` value.
17
+
18
+ ```ruby
19
+ @f = Tatara::Float.new
20
+ @f.val = "42"
21
+ # => Error!
22
+ ```
23
+
24
+ ## Methods
25
+ ### Tatara::Float#new
26
+
27
+ Create new `Tatara::Float` instance. And init `value` is `0.0`
28
+
29
+ ```ruby
30
+ @f = Tatara::Float.new
31
+ ```
32
+
33
+ ### Tatara::Float#value
34
+
35
+ return `Tatara::Float` instance value.
36
+
37
+ ```ruby
38
+ @f = Tatara::Float.new
39
+ puts @f.value
40
+ # => Show 0.0
41
+ ```
42
+
43
+ ### Tatara::Float#val
44
+
45
+ return `Tatara::Float` instance value.
46
+
47
+ ```ruby
48
+ @f = Tatara::Float.new
49
+ puts @f.val
50
+ # => Show 0.0
51
+ ```
52
+
53
+ ### Tatara::Float#value=
54
+
55
+ Set instance value for `Tatara::Float`.
56
+
57
+ ```ruby
58
+ @f = Tatara::Float.new
59
+ @f.value = 4.2
60
+ # => Set 4.2
61
+ ```
62
+
63
+ ### Tatara::Float#val=
64
+
65
+ Set instance value for `Tatara::Float`.
66
+
67
+ ```ruby
68
+ @f = Tatara::Float.new
69
+ @f.val = 4.2
70
+ # => Set 4.2
71
+ ```
72
+
73
+ ### Tatara::Float#value+
74
+
75
+ Add instance value for `Tatara::Float`.
76
+
77
+ ```ruby
78
+ @f = Tatara::Float.new
79
+ @f.value = 2.1
80
+ puts @f.value + 2.1
81
+ # => Value is 4.2
82
+ ```
83
+
84
+ ### Tatara::Float#val+
85
+
86
+ Add instance value for `Tatara::Float`.
87
+
88
+ ```ruby
89
+ @f = Tatara::Float.new
90
+ @f.value = 2.1
91
+ puts @f.val + 2.1
92
+ # => Value is 4.2
93
+ ```
94
+
95
+ ### Tatara::Float#value-
96
+
97
+ Subtract instance value for `Tatara::Float`.
98
+
99
+ ```ruby
100
+ @f = Tatara::Float.new
101
+ @f.value = 2.1
102
+ puts @f.value - 2.1
103
+ # => Value is 0.0
104
+ ```
105
+
106
+ ### Tatara::Float#val-
107
+
108
+ Subtract instance value for `Tatara::Float`.
109
+
110
+ ```ruby
111
+ @f = Tatara::Float.new
112
+ @f.value = 2.1
113
+ puts @f.val - 2.1
114
+ # => Value is 0.0
115
+ ```
116
+
117
+ ### Tatara::Float#value\*
118
+
119
+ Multiply instance value for `Tatara::Float`.
120
+
121
+ ```ruby
122
+ @f = Tatara::Float.new
123
+ @f.value = 2.0
124
+ puts @f.value * 2.0
125
+ # => Value is 4.0
126
+ ```
127
+
128
+ ### Tatara::Float#val\*
129
+
130
+ Multiply instance value for `Tatara::Float`.
131
+
132
+ ```ruby
133
+ @f = Tatara::Float.new
134
+ @f.value = 2.0
135
+ puts @f.val * 2.0
136
+ # => Value is 4.0
137
+ ```
138
+
139
+ ### Tatara::Float#value/
140
+
141
+ Divided instance value for `Tatara::Float`.
142
+
143
+ ```ruby
144
+ @f = Tatara::Float.new
145
+ @f.value = 4.0
146
+ puts @f.value / 2.0
147
+ # => Value is 2.0
148
+ ```
149
+
150
+ ### Tatara::Float#val/
151
+
152
+ Divided instance value for `Tatara::Float`.
153
+
154
+ ```ruby
155
+ @f = Tatara::Float.new
156
+ @f.value = 4.0
157
+ puts @f.val / 2.0
158
+ # => Value is 2.0
159
+ ```
160
+
161
+ ### Tatara::Float#value\*\*
162
+
163
+ Power instance value for `Tatara::Float`.
164
+
165
+ ```ruby
166
+ @f = Tatara::Float.new
167
+ @f.value = 2.0
168
+ puts @f.value ** 2.0
169
+ # => Value is 4.0
170
+ puts @f.value ** 2.0
171
+ # => Value is 8.0
172
+ ```
173
+
174
+ ### Tatara::Float#val\*\*
175
+
176
+ Power instance value for `Tatara::Float`.
177
+
178
+ ```ruby
179
+ @f = Tatara::Float.new
180
+ @f.value = 2.0
181
+ puts @f.val ** 2.0
182
+ # => Value is 4.0
183
+ puts @f.val ** 2.0
184
+ # => Value is 8.0
185
+ ```
186
+
187
+ ### Tatara::Float#value+=
188
+
189
+ Add and Set instance value for `Tatara::Float`.
190
+
191
+ ```ruby
192
+ @f = Tatara::Float.new
193
+ @f.value = 2.1
194
+ @f.value += 2.1
195
+ # => Value is 4.2
196
+ @f.value += 2.1
197
+ # => Value is 6.3
198
+ ```
199
+
200
+ ### Tatara::Float#val+=
201
+
202
+ Add and Set instance value for `Tatara::Float`.
203
+
204
+ ```ruby
205
+ @f = Tatara::Float.new
206
+ @f.val = 2.1
207
+ @f.val += 2.1
208
+ # => Value is 4.2
209
+ @f.val += 2.1
210
+ # => Value is 6.3
211
+ ```
212
+
213
+ ### Tatara::Float#value-=
214
+
215
+ Subtract and Set instance value for `Tatara::Float`.
216
+
217
+ ```ruby
218
+ @f = Tatara::Float.new
219
+ @f.value = 2.0
220
+ @f.value -= 1.0
221
+ # => Value is 1.0
222
+ @f.value -= 0.5
223
+ # => Value is 0.5
224
+ ```
225
+
226
+ ### Tatara::Float#val-=
227
+
228
+ Subtract and Set instance value for `Tatara::Float`.
229
+
230
+ ```ruby
231
+ @f = Tatara::Float.new
232
+ @f.val = 2.0
233
+ @f.val -= 1.0
234
+ # => Value is 1.0
235
+ @f.val -= 0.5
236
+ # => Value is 0.5
237
+ ```
238
+
239
+ ### Tatara::Float#value\*=
240
+
241
+ Multiply and Set instance value for `Tatara::Float`.
242
+
243
+ ```ruby
244
+ @f = Tatara::Float.new
245
+ @f.value = 2.0
246
+ @f.value *= 10.0
247
+ # => Value is 20.0
248
+ @f.value *= 5.0
249
+ # => Value is 100.0
250
+ ```
251
+
252
+ ### Tatara::Float#val\*=
253
+
254
+ Multiply and Set instance value for `Tatara::Float`.
255
+
256
+ ```ruby
257
+ @f = Tatara::Float.new
258
+ @f.val = 2.0
259
+ @f.val *= 10.0
260
+ # => Value is 20.0
261
+ @f.val *= 5.0
262
+ # => Value is 100.0
263
+ ```
264
+
265
+ ### Tatara::Float#value/=
266
+
267
+ Divided and Set instance value for `Tatara::Float`.
268
+
269
+ ```ruby
270
+ @f = Tatara::Float.new
271
+ @f.value = 2.0
272
+ @f.value /= 5.0
273
+ # => Value is 0.4
274
+ @f.value /= 2.0
275
+ # => Value is 0.2
276
+ ```
277
+
278
+ ### Tatara::Float#val/=
279
+
280
+ Divided and Set instance value for `Tatara::Float`.
281
+
282
+ ```ruby
283
+ @f = Tatara::Float.new
284
+ @f.val = 2.0
285
+ @f.val /= 5.0
286
+ # => Value is 0.4
287
+ @f.val /= 2.0
288
+ # => Value is 0.2
289
+ ```
290
+
291
+ ### Tatara::Float#value\*\*=
292
+
293
+ Power and Set instance value value for `Tatara::Float`.
294
+
295
+ ```ruby
296
+ @f = Tatara::Float.new
297
+ @f.value = 2.0
298
+ @f.value **= 2.0
299
+ # => Value is 4.0
300
+ @f.value **= 2.0
301
+ # => Value is 16.0
302
+ ```
303
+
304
+ ### Tatara::Float#val\*\*=
305
+
306
+ Power and Set instance value value for `Tatara::Float`.
307
+
308
+ ```ruby
309
+ @f = Tatara::Float.new
310
+ @f.val = 2.0
311
+ @f.val **= 2.0
312
+ # => Value is 4.0
313
+ @f.val **= 2.0
314
+ # => Value is 16.0
315
+ ```
316
+
317
+ ### Tatara::Float#value==
318
+
319
+ Check instance value, and return `Boolean`.
320
+
321
+ ```ruby
322
+ @f = Tatara::Float.new
323
+ @f.value = 4.2
324
+ puts @f.value == 4.2
325
+ # => true
326
+ puts @f.value == 6.2
327
+ # => false
328
+ ```
329
+
330
+ ### Tatara::Float#val==
331
+
332
+ Check instance value, and return `Boolean`.
333
+
334
+ ```ruby
335
+ @f = Tatara::Float.new
336
+ @f.val = 4.2
337
+ puts @f.val == 4.2
338
+ # => true
339
+ puts @f.val == 6.2
340
+ # => false
341
+ ```
342
+
343
+ ### Tatara::Float#inc
344
+
345
+ Increment for instance value.
346
+
347
+ ```ruby
348
+ @f = Tatara::Float.new
349
+ @f.val = 1.0
350
+ @f.inc
351
+ # => Increment instance value
352
+ puts @f.val
353
+ # => 2.0
354
+ ```
355
+
356
+ ### Tatara::Float#dec
357
+
358
+ Decrement for instance value.
359
+
360
+ ```ruby
361
+ @f = Tatara::Float.new
362
+ @f.val = 1.0
363
+ @f.dec
364
+ # => Increment instance value
365
+ puts @f.val
366
+ # => 0.0
367
+ ```
368
+
369
+ ### Tatara::Float#to_s
370
+
371
+ Convert to `String` for instance value.
372
+
373
+ ```ruby
374
+ @f = Tatara::Float.new
375
+ @f.val = 4.2
376
+ @f.to_s
377
+ # => Conver to String.
378
+ ```
379
+
380
+ ### Tatara::Float#to_i
381
+
382
+ Convert to `Integer` for instance value.
383
+
384
+ ```ruby
385
+ @f = Tatara::Float.new
386
+ @f.val = 4.2
387
+ @f.to_i
388
+ # => Conver to Integer.
389
+ ```
390
+
391
+ ### Tatara::Float#clear
392
+
393
+ Clear instance value.
394
+
395
+ ```ruby
396
+ @f = Tatara::Float.new
397
+ @f.val = 4.2
398
+ # => Set 4.2
399
+ @f.clear
400
+ # => Clear instance value. Value is 0.0
401
+ ```
402
+
403
+ ### Tatara::Float#equal?
404
+
405
+ Check instance value, and return `Boolean`
406
+
407
+ ```ruby
408
+ @f = Tatara::Float.new
409
+ @f.val = 4.2
410
+ puts @f.equal? 4.2
411
+ # => true
412
+ ```
413
+
414
+ ### Tatara::Float#operator<<
415
+
416
+ Set instance value for `Tatara::Float`.
417
+
418
+ ```ruby
419
+ @f = Tatara::Float.new << 4.2
420
+ puts @f.val
421
+ # => 4.2
422
+ @f = @f << 5.0
423
+ puts @f.val
424
+ # => 5.0
425
+ ```