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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e95f63521ae2309104e29ad73b4b3954a981d295814eb76727c64505c44e250
4
- data.tar.gz: 9a3a258e15233884a47b178fa2046e1e73eab1eccfec4b4e4ef853e068547456
3
+ metadata.gz: 5ae7f0c8a6441cc111cfd8600e62ae4a12fb0f2de39fc84e5a900e65acc1d19d
4
+ data.tar.gz: 9e4cba67412bf2d726e29fa5f005b319bd9ebc5774a33e5014cf226544f82c2d
5
5
  SHA512:
6
- metadata.gz: dd08f8545118415548f7233c6d9a49629f9128227332a10d3a6c213343151aeb10607e40dbdeaf7c830fa36459611d1a2ec3a3c97f66ae4f5751e85bc7fa646d
7
- data.tar.gz: db635c0c67770b8f2195e3c3f07192d4fe0f1f4298a0089ff6cd06c7082a287602833e9ab8fcb756a612e1e8adbb2e0136a3c500c7a04296520886cf6f25c3cd
6
+ metadata.gz: 890ef002815bf0d2f6df848b420b005faf77076dbf8e72cc0a6f259df32f8373db143559bfc217ef9dad30cbfcc9b7eed6598ff53b4f15cfc0f71321e6eb21b9
7
+ data.tar.gz: 65cf5c7925ac087d114b43ed28a9befff33692be3a6692e5c34c343001c8772a035683ad1aed7e6b8fd23c34dabdb70e29c55ad92bd5773c9203a35cddfdc266
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # MiniSerializer
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/mini_serializer`. To experiment with that code, run `bin/console` for an interactive prompt.
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/[USERNAME]/mini_serializer.
36
+ Bug reports and pull requests are welcome on GitHub at https://github.com/mhi20/mini_serializer.
36
37
 
37
38
  ## License
38
39
 
@@ -1,3 +1,3 @@
1
1
  module MiniSerializer
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.2".freeze
3
3
  end
@@ -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{Serialize object for export json_api}
13
- spec.description = %q{Serialize object for export json api}
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.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-24 00:00:00.000000000 Z
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: Serialize object for export json api
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: Serialize object for export json_api
81
+ summary: Serializes Activemodel object to JSON API format
82
82
  test_files: []