shard-container 0.6.3 → 0.6.5
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.
- checksums.yaml +4 -4
- data/readme.md +47 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fcb678b9d98e9b8b639314a1f45199a04c25219
|
4
|
+
data.tar.gz: b901198b01e4d704e1869f085f5a4343e130ba71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0506b9f7370bdd1b4a367c18dc383a585bee258a97c41c50d0d04f82dbc88ea665d1a2c6b60aee7007a5c3c3eb7543a0e8c5a909e5068ed7269c7817ca7f5f3
|
7
|
+
data.tar.gz: 6f15acb2f6c60a1a4f143c114d72161a6d18be49a8ae02ec0fca4418d7ddb1a76ecda2fb6f01d20434f7dd65647eec7de9d1dc47de15cc3edbca6cb0c5b47b05
|
data/readme.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# Shard
|
2
|
+
|
3
|
+
## What is Shard?
|
4
|
+
> Shard is an intuitive container class that allows extended capabilities of Hashes and arrays, as well as extra methods for formatting and aliases.
|
5
|
+
|
6
|
+
## Methods
|
7
|
+
> #### Initialization
|
8
|
+
> A shard's initial id parameter can be set to either a String, Symbol, or Fixnum.
|
9
|
+
> test1=Shard.new(:testShard)
|
10
|
+
> test2=Shard.new('testShard') #different id than the test1
|
11
|
+
> test3=Shard.new(3)
|
12
|
+
>
|
13
|
+
> #### Adding to a shard
|
14
|
+
> Adding to a shard can be done one of two ways.
|
15
|
+
> test=Shard.new(:test)
|
16
|
+
> test.add('foo',:bar,123)
|
17
|
+
> test.values<<['foo',:bar,123] #this can be cleaned up later
|
18
|
+
>
|
19
|
+
> #### Deleting shard elements
|
20
|
+
> Deleting from a shard is also easily done.
|
21
|
+
> test=Shard.new(:test) #initialize the shard
|
22
|
+
> test.add('foo',:bar,123) #add to the shard
|
23
|
+
>
|
24
|
+
> test.keyDelete('foo') #delete by key
|
25
|
+
> test.valDelete(':bar') #delete by value
|
26
|
+
> test.indexDelete(0) #delete by index, works with ranges by using 2 parameters
|
27
|
+
>
|
28
|
+
> #### Correction
|
29
|
+
> Shards also supply a few formatting methods.
|
30
|
+
> test=Shard.new(:test) #initialize the shard
|
31
|
+
> x.values<<[1,2,3] #add to the shard
|
32
|
+
> => [[1, 2, 3]]
|
33
|
+
> test.corr #converts the manually added array to a formatted struct
|
34
|
+
> => [#<struct key=1, val=2, util=3>]
|
35
|
+
>
|
36
|
+
> #### Pruning
|
37
|
+
> Pruning a shard's unique keys, values, or utilities is accomplished using the following aliases, or a raw `Shard.prune` method call using any combination of `:key`,`:val`, or `:util` as parameters.
|
38
|
+
> Shard.pruneKeys #prune by keys
|
39
|
+
> Shard.pruneVals #prune by values
|
40
|
+
> Shard.pruneUtils #prune by utilities
|
41
|
+
> Shard.pruneAll #prune by all parameters
|
42
|
+
>
|
43
|
+
> #### Cleaning shards
|
44
|
+
> Cleaning a shard using the `.clean` method returns an Array (nested, if more than one k/v/u set is selected) of readable sets with all elements in their original types.
|
45
|
+
> Shard.clean #cleans and returns entire shard
|
46
|
+
> Shard.clean(0) #cleans and returns shard element at index 0
|
47
|
+
> Shard.clean(0,2) #cleans and returns shard elements at indexes 0 to 2
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shard-container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chitoge
|
@@ -15,15 +15,18 @@ description: An intuitive new container class for everyone from the everyday use
|
|
15
15
|
email: RRTechFreelance@gmail.com
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
|
-
extra_rdoc_files:
|
18
|
+
extra_rdoc_files:
|
19
|
+
- readme.md
|
19
20
|
files:
|
20
21
|
- lib/shard.rb
|
21
22
|
- lib/shard/formatting.rb
|
23
|
+
- readme.md
|
22
24
|
homepage: https://github.com/Nevermore-BD/Shard
|
23
25
|
licenses:
|
24
26
|
- MIT
|
25
27
|
- IBM Public License
|
26
|
-
metadata:
|
28
|
+
metadata:
|
29
|
+
homepage: https://github.com/Nevermore-BD/Shard
|
27
30
|
post_install_message:
|
28
31
|
rdoc_options: []
|
29
32
|
require_paths:
|