arstotzka 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a70660893bc21a19b77a770a016e39ccc26b3431fe01a06a0ecc936b51f92a9
4
- data.tar.gz: 80408387f645d0da90018e81601659594a329b4191c76fb8ae41895e1233e217
3
+ metadata.gz: cf09874e1c7b4c1ee67ff4038a5f8b1bd1739941f6d85e215c458af9fd95f680
4
+ data.tar.gz: 8182d26a6a31032f40c2b8146aee6d9788e7b98e4c5d5514e62abfae33a85f41
5
5
  SHA512:
6
- metadata.gz: 4660167e32e9a78c71d492747c7213929f1a988d0df5f5450c8a77e404a9f9172c11303b3759f201e18d492a963f17425f15c107506fd048c178443bab42c557
7
- data.tar.gz: db79939e7c261a462469a159ef3d2b7eed86a851b1aace88c4ce7c9a63662cd65417fe133561e733ba39d08587ba564af6331327f743b26e146096f7f5066cf3
6
+ metadata.gz: 2b555760d473743c560ea459a19871d89daf8a48006b4bba72e7cc8e3d5ad3cb775ef0280583893ab3f13c48c5f6252d20cac5cf545627a1e6c52e089bf18264
7
+ data.tar.gz: d0038633713c2a318d2c098e22b7cbb8930756abbc1f5f19bdb8e76975e9a4e6fec223470d44691424199ea0bbfb038d0432be189ee274939eb01521a1b037eb
data/README.md CHANGED
@@ -17,6 +17,10 @@ Arstotzka is also usefull when you need keys case changed or data type cast as i
17
17
  to be a bridge between a rails application and a Java API (Java APIs use cameCase for
18
18
  JSON keys)
19
19
 
20
+ Yard Documentation
21
+ -------------------
22
+ https://www.rubydoc.info/gems/arstotzka/1.2.4
23
+
20
24
  Instalation
21
25
  ---------------
22
26
  1. Add Arstotzka to your `Gemfile` and `bundle install`:
@@ -36,10 +40,6 @@ gem 'arstotzka'
36
40
  bundle install arstotzka
37
41
  ```
38
42
 
39
- Yard Documentation
40
- -------------------
41
- https://www.rubydoc.info/gems/arstotzka/1.2.3
42
-
43
43
  Getting Started
44
44
  ---------------
45
45
  1. Include in a class that you want to wrap a json/hash
data/arstotzka.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_runtime_dependency 'activesupport', '~> 5.x'
22
- spec.add_runtime_dependency 'sinclair', '>= 1.1.3'
22
+ spec.add_runtime_dependency 'sinclair', '>= 1.2.0'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.16.1'
25
25
  spec.add_development_dependency 'pry-nav', '~> 0.2.4'
@@ -89,7 +89,7 @@ module Arstotzka
89
89
  # @see Sinclair
90
90
  def add_attr(attribute)
91
91
  klass.add_fetcher(attribute, options)
92
- add_method attribute, (cached ? cached_fetcher(attribute) : attr_fetcher(attribute)).to_s
92
+ add_method attribute, attr_fetcher(attribute), cached: cached
93
93
  end
94
94
 
95
95
  # Returns the code needed to initialize fetcher
@@ -107,18 +107,5 @@ module Arstotzka
107
107
  end
108
108
  CODE
109
109
  end
110
-
111
- # Returns the code needed to initialize a fetche and cache it
112
- #
113
- # @param [String,Symbol] attribute name of method / attribute
114
- #
115
- # @return [String] method code
116
- #
117
- # @see #attr_fetcher
118
- def cached_fetcher(attribute)
119
- <<-CODE
120
- @#{attribute} ||= #{attr_fetcher(attribute)}
121
- CODE
122
- end
123
110
  end
124
111
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Arstotzka
4
- VERSION = '1.2.3'
4
+ VERSION = '1.2.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arstotzka
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darthjee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-27 00:00:00.000000000 Z
11
+ date: 2019-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.3
33
+ version: 1.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.1.3
40
+ version: 1.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement