configurable_with 0.1.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/configurable_with.rb +23 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 68d7661d9ecf5aa85cec680d536b332a55d32a35
4
+ data.tar.gz: 4fddb4119cd5f2b1ebfadbf040f8bc9d2d7a7526
5
+ SHA512:
6
+ metadata.gz: 92ad21a7998efdf1082ee8140af301c75071662bad60777f54d620254b0e950ece21c8d122377292233ea3c5b3886b828ce4c584f20e6417b30fdf9cd4627287
7
+ data.tar.gz: 43d3d89b2aebc91a5964c75263714b93669c59e60eb77a64a9fd121c87ad707d2f6a9d480d5eedbe2b56f0e2f1b2399900e6a77a221528ca9d37bea20d1f36d9
@@ -0,0 +1,23 @@
1
+ module ConfigurableWith
2
+ def self.options(*attrs)
3
+ config_class = Class.new do
4
+ attr_accessor *attrs
5
+ end
6
+
7
+ methods_class = Module.new do
8
+ define_method :config do
9
+ @config ||= config_class.new
10
+ end
11
+
12
+ def configure
13
+ yield config
14
+ end
15
+ end
16
+
17
+ Module.new do
18
+ singleton_class.send :define_method, :included do |target_class|
19
+ target_class.extend methods_class
20
+ end
21
+ end
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: configurable_with
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jiri Prochazka
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-12-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple module making any class configurable.
14
+ email: prochazka@coderocket.co
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/configurable_with.rb
20
+ homepage: https://github.com/CodeRocketCo/configurable_with
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.6.8
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: A simple module making any class configurable.
44
+ test_files: []