mini_serializer 0.1.1 → 0.1.2
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 -10
- data/lib/mini_serializer/version.rb +1 -1
- data/mini_serializer.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ae7f0c8a6441cc111cfd8600e62ae4a12fb0f2de39fc84e5a900e65acc1d19d
|
4
|
+
data.tar.gz: 9e4cba67412bf2d726e29fa5f005b319bd9ebc5774a33e5014cf226544f82c2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 890ef002815bf0d2f6df848b420b005faf77076dbf8e72cc0a6f259df32f8373db143559bfc217ef9dad30cbfcc9b7eed6598ff53b4f15cfc0f71321e6eb21b9
|
7
|
+
data.tar.gz: 65cf5c7925ac087d114b43ed28a9befff33692be3a6692e5c34c343001c8772a035683ad1aed7e6b8fd23c34dabdb70e29c55ad92bd5773c9203a35cddfdc266
|
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# MiniSerializer
|
2
2
|
|
3
|
-
|
3
|
+
Serialize object for export json api
|
4
4
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
@@ -21,18 +20,20 @@ Or install it yourself as:
|
|
21
20
|
$ gem install mini_serializer
|
22
21
|
|
23
22
|
## Usage
|
23
|
+
### Initialize
|
24
|
+
serializer=MiniSerializer::Serializer.new(House.all)
|
25
|
+
### Initialize with except params
|
26
|
+
serializer=MiniSerializer::Serializer.new(House.all,{except:[:id,:title]})
|
27
|
+
### Associations
|
28
|
+
serializer.add_has_many('house_images',['id','house_id','created_at','updated_at'])
|
29
|
+
serializer.add_has_one('house_type',['id'])
|
30
|
+
### Parse data with json_serializer
|
31
|
+
render json:serializer.json_serializer
|
24
32
|
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
33
|
|
33
34
|
## Contributing
|
34
35
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
36
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/mhi20/mini_serializer.
|
36
37
|
|
37
38
|
## License
|
38
39
|
|
data/mini_serializer.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["mahdi alizadeh"]
|
10
10
|
spec.email = ["mahdializadeh20@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{
|
12
|
+
spec.summary = %q{Serializes Activemodel object to JSON API format}
|
13
|
+
spec.description = %q{Serializes Activemodel object to JSON API format}
|
14
14
|
spec.homepage = "https://github.com/mhi20/mini_serializer"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mahdi alizadeh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
description:
|
41
|
+
description: Serializes Activemodel object to JSON API format
|
42
42
|
email:
|
43
43
|
- mahdializadeh20@gmail.com
|
44
44
|
executables: []
|
@@ -78,5 +78,5 @@ rubyforge_project:
|
|
78
78
|
rubygems_version: 2.7.6
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
|
-
summary:
|
81
|
+
summary: Serializes Activemodel object to JSON API format
|
82
82
|
test_files: []
|