as_json_representations 0.1.0 → 0.2.0

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
- SHA1:
3
- metadata.gz: 5a524e14de5c1fa45c7f5593476e800e2de0203b
4
- data.tar.gz: 38ad660a2b052693ff40b16d99bb7e57da0dcd1f
2
+ SHA256:
3
+ metadata.gz: 6d7ce0e4ea64715ea7104e752ce7a5e19ae965cb65dcd5c771a677224578e1e6
4
+ data.tar.gz: fcefce4937dfb9ffc67723f7f263f81ca1f13cbe7ecbf152bc174b4713110c38
5
5
  SHA512:
6
- metadata.gz: 836ce2034db29b36953c6b34ff1f9aeb430a73bc29297fedcdb28aea1e3a745a220c5db7f00094b5f0c7fb726c48d774fc857ca0f7c4d938f8b525ea52de0385
7
- data.tar.gz: eb628c99afabb85a16b74c64d2b40615976325ac6d22035adfc0f023c980d1268e3fbe3311cd4c0a8f18c9f73f88b9f605ed173236d2a78f875292a1dd2e1e25
6
+ metadata.gz: 179b536f2bd9c3f2cfea67f97dcfae09d827e1cebf9dd10f0702145ce2a0fe61ddd921f0285e625446e30fe93bd13d64a4aa4c9498d89dd4aafc3a999e87745a
7
+ data.tar.gz: e7d6806a997899b7b10cb90b33a6563151c840579b65ccda89c0e59997d09e98a53574b54f99889c3b163b40385ffa1a52f9f2d21337bbad35de3a67add9f55a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- as_json_representations (0.1.0)
4
+ as_json_representations (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -32,4 +32,4 @@ DEPENDENCIES
32
32
  rspec (~> 3.0)
33
33
 
34
34
  BUNDLED WITH
35
- 1.16.0.pre.3
35
+ 1.16.1
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # AsJsonRepresentations
2
+ [![Gem Version](https://badge.fury.io/rb/as_json_representations.svg)](https://badge.fury.io/rb/as_json_representations)
3
+ ![Build Status](https://travis-ci.org/rjurado01/as_json_representations.svg?branch=master)
2
4
 
3
5
  Creates representations of your model data in a simple and clean way.
4
6
 
@@ -43,7 +45,7 @@ class User
43
45
  }
44
46
  end
45
47
 
46
- representation :private, extend: :public do # you can extends other representations
48
+ representation :private, extend: :public do # you can extends another representations
47
49
  {
48
50
  age: age,
49
51
  city: city.as_json(representation: :basic)
@@ -1,3 +1,3 @@
1
1
  module AsJsonRepresentations
2
- VERSION = "0.1.0"
2
+ VERSION = '0.2.0'
3
3
  end
@@ -31,7 +31,11 @@ module AsJsonRepresentations
31
31
  base.class_eval do
32
32
  eval %{
33
33
  def as_json(options={})
34
- #{base}.render_representation(self, options)
34
+ if !options[:representation] && defined?(super)
35
+ super(options)
36
+ else
37
+ #{base}.render_representation(self, options)
38
+ end
35
39
  end
36
40
  }
37
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: as_json_representations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rjurado01
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-21 00:00:00.000000000 Z
11
+ date: 2018-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  requirements: []
94
94
  rubyforge_project:
95
- rubygems_version: 2.6.13
95
+ rubygems_version: 2.7.3
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Creates representations of your model data