pseudo_entity 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: 580a5043791113500f6b120fa786b3d282c081633b87c2965df9c7e27c4c22d4
4
- data.tar.gz: 4520dc910820ef9cb0b21d7f586bd499290ffe4b9529281d8a4b53451d469417
3
+ metadata.gz: c8c1b99c3605d34f765ad5397efa7a31bc666d12be6f971c72151714e916c13c
4
+ data.tar.gz: 25a8f5f42de887f600cfbbafcfa5b79b599cc035d480338a263f44c837954f0b
5
5
  SHA512:
6
- metadata.gz: 86339ea73c7976105494430bf6b88b1307abd91785bb99b219db7652973f068ead9e0939f3ca8d0a317d064502d16a335fa68afab2521131ecc6c4f979f02471
7
- data.tar.gz: 679029ff226b6862dea0221a2b90cda7095f455fdf060a8b821756be4b1256320c4079f0b281e62fc5d1756227e5f2945d626bfa0f1719f1306601d6b2f210d8
6
+ metadata.gz: a60cd99129b2278469337b6084ccba9c8aef1c8eb5ed15e97905e4e96f22413fb0e2b3e638bd7148a9af84d356183a7e32da01dc185a68e10276ac1c84276d91
7
+ data.tar.gz: 94f236e2022a93edee5a32c24bb090aec1e1b55da019b09d07dd47789d7ad59b60dfd55a9836d34dd6fd6f6143707d1252b0d63b3c88252b4d47cbb3bd67c660
@@ -33,11 +33,9 @@ module PseudoEntity::Randoms
33
33
 
34
34
  # Create the lazy loading accessors
35
35
  RandomValues.each do |value_name|
36
- class_eval %{
37
- def #{value_name}
38
- @#{value_name} ||= random_#{value_name}
39
- end
40
- }
36
+ iv = :"@#{value_name}"
37
+ random_value = "random_#{value_name}"
38
+ define_method(value_name) { instance_variable_set(iv, instance_variable_get(iv) || send(random_value)) }
41
39
  end
42
40
 
43
41
  # Im still not happy about this but at least it is out of PseudoEntity.
@@ -1,3 +1,3 @@
1
1
  class PseudoEntity
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pseudo_entity
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
  - Frank Hall
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-20 00:00:00.000000000 Z
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.1.2
117
+ version: 0.1.3
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.1.2
124
+ version: 0.1.3
125
125
  description: A class for generating realistic looking data for people, companies,
126
126
  etc.
127
127
  email:
@@ -146,7 +146,7 @@ licenses:
146
146
  - MIT
147
147
  metadata:
148
148
  homepage_uri: https://github.com/ChapterHouse/pseudo_entity
149
- source_code_uri: https://github.com/ChapterHouse/pseudo_entity/tree/v0.1.1
149
+ source_code_uri: https://github.com/ChapterHouse/pseudo_entity/tree/v0.1.2
150
150
  post_install_message:
151
151
  rdoc_options: []
152
152
  require_paths:
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  requirements: []
165
- rubygems_version: 3.2.33
165
+ rubygems_version: 3.4.1
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: A class for generating realistic looking data for people, companies, etc.