proto_factory 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/proto_factory/builder.rb +13 -0
- data/lib/proto_factory/configuration.rb +5 -0
- data/lib/proto_factory.rb +18 -3
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21d0092504f851463d7d50ecd099379401ffd5bf
|
4
|
+
data.tar.gz: 905f1e391a2121ba3d7f6c1a7bb5dfbda744dafa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d88706ca834f204c842701ef0284f955f8de52d97c66b5597f851e03bd64188f5aa3dc698f46854017be4e5e8f7927c92465f1c3c66ecf64f27eadb214ee0bf5
|
7
|
+
data.tar.gz: 8a6a26135dc6b1d4235eba9ce0120283e0ebfd7e26d66e2ab0c6503d5899fe23925945fda9ef1ed399c5d853e4af1f79cb8b9e9d4f281b2dfaa244f4d2231cdc
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module ProtoFactory
|
2
|
+
class Builder
|
3
|
+
|
4
|
+
def self.build(factory_name)
|
5
|
+
factory_class = self.find(factory_name).safe_constantize
|
6
|
+
# other logic
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.find(factory_name)
|
10
|
+
ProtoFactory::Configuration.factories[factory_name.to_sym]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/proto_factory.rb
CHANGED
@@ -1,5 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
require "proto_factory/configuration"
|
2
|
+
require "proto_factory/builder"
|
3
|
+
|
4
|
+
module ProtoFactory
|
5
|
+
class << self
|
6
|
+
attr_writer :configuration
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.configuration
|
10
|
+
@configuration ||= Configuration.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.reset
|
14
|
+
@configuration = Configuration.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.configure
|
18
|
+
yield(configuration)
|
4
19
|
end
|
5
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proto_factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucas Moore, Terese Lichty, Marshall Houston
|
@@ -17,6 +17,8 @@ extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
19
|
- lib/proto_factory.rb
|
20
|
+
- lib/proto_factory/builder.rb
|
21
|
+
- lib/proto_factory/configuration.rb
|
20
22
|
homepage: https://ibotta.com
|
21
23
|
licenses:
|
22
24
|
- MIT
|