zeamays 0.0.5 → 0.0.6
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/.travis.yml +1 -0
- data/README.md +26 -2
- data/lib/zeamays/cob.rb +4 -0
- data/lib/zeamays/cob/defreezing.rb +8 -0
- data/lib/zeamays/cob/freezing.rb +7 -0
- data/lib/zeamays/version.rb +1 -1
- data/spec/model_test/zeamays_mode_example_spec.rb +10 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63c64b1abe873452b3a50f93df15acc7c37201e9
|
4
|
+
data.tar.gz: 31593cf69e4c7a3b281d890319752f5ca7dd1696
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 300eeb8608f053cfc6275ee0b944859fbbb0ceeb42fa26c217c69ae717a8964c475a1d566efb9380481b982d041fc0dba6ad231ce9a03a740031aa1d7b24d83b
|
7
|
+
data.tar.gz: 364538df09fae0b35285de80254e4b2ae50b85eb46ddd6a50e823e7587a37cbb52aa103e7c8b242cc3063d8446ea3baff7be33a17f7d052869cd564b61a0e8d6
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -23,7 +23,7 @@ Or install it yourself as:
|
|
23
23
|
Declare Modeling for
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
class
|
26
|
+
class YellowSweet < Zeamays::Cob
|
27
27
|
gene_sequencing :i8, :i16, :integer, :string
|
28
28
|
end
|
29
29
|
```
|
@@ -44,10 +44,34 @@ Use for `grow` or `grow!` method(`grow` method is alias for `grow!`).
|
|
44
44
|
for example
|
45
45
|
|
46
46
|
```ruby
|
47
|
-
yellow_sweet =
|
47
|
+
yellow_sweet = YellowSweet.new
|
48
48
|
yellow_sweet.grow 30, 2000, 500000, "test"
|
49
49
|
```
|
50
50
|
|
51
|
+
## Packing (Serialization)
|
52
|
+
|
53
|
+
Use for `pack` method.
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
yellow_sweet.pack
|
57
|
+
```
|
58
|
+
|
59
|
+
returned **serialized** String.
|
60
|
+
|
61
|
+
## Unpacking (Deserialization)
|
62
|
+
|
63
|
+
Use for `unpack` **class method**.
|
64
|
+
|
65
|
+
```ruby
|
66
|
+
YellowSweet.unpack(packed_string)
|
67
|
+
```
|
68
|
+
|
69
|
+
returned **deserialized** values.
|
70
|
+
|
71
|
+
## Persistation for File System
|
72
|
+
|
73
|
+
TODO
|
74
|
+
|
51
75
|
## Contributing
|
52
76
|
|
53
77
|
1. Fork it ( https://github.com/[my-github-username]/zeamays/fork )
|
data/lib/zeamays/cob.rb
CHANGED
data/lib/zeamays/cob/freezing.rb
CHANGED
data/lib/zeamays/version.rb
CHANGED
@@ -2,10 +2,10 @@ require "zeamays"
|
|
2
2
|
|
3
3
|
describe "Zeamays Model example" do
|
4
4
|
let(:example_cob_class) {
|
5
|
-
class
|
5
|
+
class YellowSweet < Zeamays::Cob
|
6
6
|
gene_sequencing :i8, :i16, :integer, :string
|
7
7
|
end
|
8
|
-
|
8
|
+
YellowSweet
|
9
9
|
}
|
10
10
|
|
11
11
|
let(:cob) { example_cob_class.new }
|
@@ -18,5 +18,12 @@ describe "Zeamays Model example" do
|
|
18
18
|
|
19
19
|
let(:packaged) { cob.pack }
|
20
20
|
let(:unpackaged) { example_cob_class.unpack(packaged) }
|
21
|
-
it { unpackaged.
|
21
|
+
it { expect(unpackaged).to eq [record1, record2] }
|
22
|
+
|
23
|
+
describe "#defreeze" do
|
24
|
+
let(:freezed) { cob.freezed }
|
25
|
+
let(:defreezed) { example_cob_class.defreeze(freezed) }
|
26
|
+
it { expect(defreezed[0]).to eq record1 }
|
27
|
+
it { expect(defreezed[1]).to eq record2 }
|
28
|
+
end
|
22
29
|
end
|