mini_serializer 0.1 → 0.1.1

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: ba3ec71be4020509949ff6850dfc3449631dbac975f7dc013cd02cc757f3748a
4
- data.tar.gz: a1e5275a9f78834454193da57ebabaa305c86bc54549dff9d9a2bae5bd23373c
3
+ metadata.gz: 5e95f63521ae2309104e29ad73b4b3954a981d295814eb76727c64505c44e250
4
+ data.tar.gz: 9a3a258e15233884a47b178fa2046e1e73eab1eccfec4b4e4ef853e068547456
5
5
  SHA512:
6
- metadata.gz: 989db2250b76ba959d7334ef1abd4ae8e017420602c5b1cb52c591a356774e765bb6778ad6e4cea6943b6ad4d5adc8d85f4f713d6a9562dc5d39e71ee96730b3
7
- data.tar.gz: 5defd5d946390493b36e31ecffb75301284af2f24dcf9d9e1592d54f5aab188493b85672a343fad8e18a2b2e65eb51a44361f22e0b7ebfdeef64336b22a8916b
6
+ metadata.gz: dd08f8545118415548f7233c6d9a49629f9128227332a10d3a6c213343151aeb10607e40dbdeaf7c830fa36459611d1a2ec3a3c97f66ae4f5751e85bc7fa646d
7
+ data.tar.gz: db635c0c67770b8f2195e3c3f07192d4fe0f1f4298a0089ff6cd06c7082a287602833e9ab8fcb756a612e1e8adbb2e0136a3c500c7a04296520886cf6f25c3cd
data/.gitignore CHANGED
@@ -10,4 +10,5 @@
10
10
  /.idea
11
11
  /.idea/*
12
12
  .idea/*
13
- Gemfile.lock
13
+ Gemfile.lock
14
+ *.gem
@@ -1,3 +1,3 @@
1
1
  module MiniSerializer
2
- VERSION = "0.1".freeze
2
+ VERSION = "0.1.1".freeze
3
3
  end
@@ -12,19 +12,19 @@ module MiniSerializer
12
12
  @wams_except_params_main_object=except_params[:except]
13
13
  end
14
14
 
15
- def self.add_has_many(object,except_methods=[])
15
+ def add_has_many(object,except_methods=[])
16
16
  wams_has_many.append [object,except_methods]
17
17
  end
18
18
 
19
- def self.add_has_one(object,except_methods=[])
19
+ def add_has_one(object,except_methods=[])
20
20
  wams_has_one<<[object,except_methods]
21
21
  end
22
22
 
23
- def self.get_included_objects
23
+ def get_included_objects
24
24
  return wams_association_object
25
25
  end
26
26
 
27
- def self.json_serializer
27
+ def json_serializer
28
28
  included_data=includes_to_serlizer
29
29
  var_hash={}
30
30
 
@@ -48,7 +48,7 @@ module MiniSerializer
48
48
  :wams_except_params,:wams_main_object,:wams_association_for_to_json,
49
49
  :wams_except_params_main_object
50
50
 
51
- def self.includes_to_serlizer
51
+ def includes_to_serlizer
52
52
  data_with_includes=nil
53
53
  fetch_association_objects
54
54
  if wams_has_many.any?
@@ -60,7 +60,7 @@ module MiniSerializer
60
60
  return data_with_includes
61
61
  end
62
62
 
63
- def self.fetch_association_objects
63
+ def fetch_association_objects
64
64
  wams_has_many.map do |object_asoc,except_params|
65
65
  wams_association_for_to_json.store(object_asoc,{except: except_params}) # for to_json hash
66
66
  wams_association_object<<object_asoc # for included (relation record)
metadata CHANGED
@@ -1,7 +1,7 @@
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mahdi alizadeh