datory 1.0.0.rc15 → 1.0.0.rc17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -6
- data/lib/datory/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff1061ed5efc8ae9bb2b2869d8c745de7576adbb85758c1ed0655f6159e0e191
|
4
|
+
data.tar.gz: e0040ac246130dd097433a3f472b94dcf6022ce334ba8213af31336d87fdbcd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b38dbd31412aa31012c51b6e9fda0efa2a5bbabb946904491670127c69965d20c8e6e962c8666259e64a25a47bf89e3464d457600dfa7bbff152bf6b237e5b18
|
7
|
+
data.tar.gz: 50310262dfe8d781cb869091fdcbadac1da85a8c3769b1988f8465786919861fe151ecc6299667b19ae7733cd269ab61d89831ef19c38dfe40fb2bbf141628b1
|
data/README.md
CHANGED
@@ -25,24 +25,29 @@ user = User.find(...)
|
|
25
25
|
UserDto.serialize(user) # => { ... }
|
26
26
|
```
|
27
27
|
|
28
|
+
#### Deserialize
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
UserDto.deserialize(json) # => Datory::Result
|
32
|
+
```
|
33
|
+
|
34
|
+
#### Form
|
35
|
+
|
28
36
|
For serialization, the `form` method is also available.
|
29
37
|
This prepares a `Form` object, which has a set of additional methods such as `valid?` and `invalid?`.
|
30
38
|
|
31
39
|
```ruby
|
32
40
|
form = UserDto.form(user)
|
33
41
|
|
42
|
+
form.target # => UserDto
|
43
|
+
form.model # => { ... }
|
44
|
+
|
34
45
|
form.valid? # => true
|
35
46
|
form.invalid? # => false
|
36
47
|
|
37
48
|
form.serialize # => { ... }
|
38
49
|
```
|
39
50
|
|
40
|
-
#### Deserialize
|
41
|
-
|
42
|
-
```ruby
|
43
|
-
UserDto.deserialize(json) # => Datory::Result
|
44
|
-
```
|
45
|
-
|
46
51
|
#### Examples
|
47
52
|
|
48
53
|
```ruby
|
data/lib/datory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sokolov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -48,16 +48,16 @@ dependencies:
|
|
48
48
|
name: servactory
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2.5.
|
53
|
+
version: 2.5.1
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 2.5.
|
60
|
+
version: 2.5.1
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: terminal-table
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|