instancize 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/instancize.rb +9 -0
  3. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: db608cf314f1a162c19bd985c2cf3d8decce3efb4d7cbb36000da5ade896399f
4
+ data.tar.gz: 9a75a005ff9f43c56da4be93663144e06e0bc7c9726a4773746cfa1b9ad7a292
5
+ SHA512:
6
+ metadata.gz: d8e5b85220674633ea1dbbcf2f9f4101985ca0128257ccf595fdd08b6a6b4e53f579eeecfb8ddb831206b06c881df46a3350fc62c6944698ef2a0f8f43d4e14d
7
+ data.tar.gz: 7f76e53e493f0bb07eb1b8cdf0906f8f844215a41146b35761468f4f91b31d447766b21eb38a72a6aa11b13daa5b7287f4444a6672e2f5488c3a7f8ba77e3a5d
data/lib/instancize.rb ADDED
@@ -0,0 +1,9 @@
1
+ module Instancize
2
+ def self.from_binding(binding)
3
+ locals = binding.local_variables
4
+ locals.each do |variable|
5
+ local = binding.local_variable_get(variable)
6
+ binding.receiver.instance_variable_set("@#{variable}", local)
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: instancize
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Fell Sunderland
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-12-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/instancize.rb
20
+ homepage: https://rubygems.org/gems/instancize
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: 2.0.0
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubygems_version: 3.4.10
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: Turn your local variables into instance variables!
43
+ test_files: []