pseudo_entity 0.1.0 → 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: 67f8a85e3fe08c09eda5f3100bdc882689afde2c456d9b4ce40689f9da6ddcdb
4
- data.tar.gz: d40a2dae8ab2fdc9c3fe0128e5fbc4f545a0a25de1addc7ca39bd889da1cbb34
3
+ metadata.gz: c8c1b99c3605d34f765ad5397efa7a31bc666d12be6f971c72151714e916c13c
4
+ data.tar.gz: 25a8f5f42de887f600cfbbafcfa5b79b599cc035d480338a263f44c837954f0b
5
5
  SHA512:
6
- metadata.gz: a46f26e2311b6b91d71acf023eedd9cecaf873beabdce1a4f6ed0788e43944e0041702dcbfd0678642d745d185776d7bb39b5b2ba208a7bcf657aac04b02addf
7
- data.tar.gz: 1de9d7a489007fd015f0ac28de120ecf190ceced78d152e55b32561d3b3fed86ca3680d4d4e199acd32cb7341bccc4dd95a0e7e7ab68b19055879ef3d98cca31
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.0"
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.0
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: 2022-07-08 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'
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'
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.0
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.32
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.