dominate 0.2.2 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5600920b37b6799b8b026fa536b4a292461b3d27
4
- data.tar.gz: 2de8938a45752ecee763249dba4f219f8ce8002b
3
+ metadata.gz: 5250f7b20a0370a8f8bbcc6f1c23567edfb01b49
4
+ data.tar.gz: b20458793cbdcd7601e64b36f664cbdea55aed32
5
5
  SHA512:
6
- metadata.gz: b1fad8e73677983c7e365e32ebae730ab5bd07380a1d778abd6cf8c56380eb2cac832757ca1f5de3975a0be68235898f708e14dda1103682a34ee89b035ff5bb
7
- data.tar.gz: 4afc8ea69b29be8dca0eb010c7a8e333ed59680dbd8b6a237a28e608fd88c859948c68778903dba27a618d319da3c94cf5b98d5f9150e3333491747d7480df1c
6
+ metadata.gz: daa9476cfb24b1b1b96a8868b847bb049e295e0f98c3a8325d5e099a041f5c94f7557880838f105c785debfe76d53b350c12644032fa3ca4a278307867c7a252
7
+ data.tar.gz: b082ab2449e445033f1c31195b41352c025bb6abacda3624126ab583012dd3a79e9ae0a68521c12938d7067affe6c928f4f258c1ae70f000ed37ac0af68db40a
@@ -1,10 +1,21 @@
1
1
  module Dominate
2
- class Instance < Struct.new(:instance, :config)
2
+ class Instance
3
+ def initialize instance, config
4
+ @__config__ = config
5
+ @__instance__ = instance
6
+
7
+ instance.instance_variables.each do |name|
8
+ instance_variable_set name, instance.instance_variable_get(name)
9
+ end
10
+
11
+ instance
12
+ end
13
+
3
14
  def method_missing method, *args, &block
4
- if config.respond_to? method
5
- config.send method
6
- elsif instance.respond_to? method
7
- instance.send method
15
+ if @__config__.respond_to? method
16
+ @__config__.send method
17
+ elsif @__instance__.respond_to? method
18
+ @__instance__.send method
8
19
  else
9
20
  super
10
21
  end
@@ -1,3 +1,3 @@
1
1
  module Dominate
2
- VERSION = "0.2.2"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dominate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj