interactor-clearcontext 0.1.10 → 0.1.11

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
  SHA256:
3
- metadata.gz: 6f050e63c5f838a4ef523171886bb80fb71ef9915a77fa315199db37c5caad74
4
- data.tar.gz: 1109b3b0b04acc062292c492bf83de595c91d80c9f616eb5b0735aabe18432a8
3
+ metadata.gz: 7b6f60b12abb603606c6f0f0be3588c7d0f4a9ed2e3f98d456b0c3b4b4a9a57b
4
+ data.tar.gz: f39f31bcde41dafb476c34f0edfc723f6d19bc4a59609060741c86ccde6d7673
5
5
  SHA512:
6
- metadata.gz: 36349db92e3e5576d58bc50740410646b483a925cf9f5f94f468e67f13b6034daa572b2a3358ce67f015dd8cb92cc088595abd2a9e98a279f295a9a8cca76df8
7
- data.tar.gz: fe4085bbfa44024370881a828bc57b558006f4ae484b4db759a2be84b090e155703048ed9922df29791580a7379d20dab029f77289b2259715470196ec1bc219
6
+ metadata.gz: 7174b8ec2409d7d26f1a1bc6047e3234932fa97764265c900baea6ae11b46e1df399346cca535461426a0634cc383cbd7f6ff4f8eaa0f2cc9c7596817852a980
7
+ data.tar.gz: '08ff3c7019eafc794aea64c177d89f76ce067779ee934d61f520106a30619febd2266e6f034714a7418d5cfa3d9b833761efc85b34d4005471c494e6d4ddbbf2'
@@ -1,6 +1,5 @@
1
1
  module Interactor
2
2
  module ClearContext
3
-
4
3
  module ContextAccessor
5
4
 
6
5
  def self.included(base)
@@ -11,20 +10,16 @@ module Interactor
11
10
 
12
11
  module ClassMethods
13
12
  def self.require_contexts(*attributes)
14
- Array(attributes).each do |attribute|
15
- # define getter
13
+ attr_writer attributes
14
+ # define getter
15
+ attributes.each do |attribute|
16
16
  define_method attribute do
17
- context.send attribute
18
- end
19
- # define setter
20
- define_method "#{attribute.to_s}=" do |value|
21
- context.send "#{attribute.to_s}=", value
17
+ instance_variable_get("@#{attribute}") ||= context.send(attribute)
22
18
  end
23
19
  end
24
20
  end
25
21
  end
26
22
 
27
23
  end
28
-
29
24
  end
30
25
  end
@@ -1,5 +1,5 @@
1
1
  module Interactor
2
2
  module ClearContext
3
- VERSION = "0.1.10"
3
+ VERSION = "0.1.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interactor-clearcontext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - uesaiso
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-28 00:00:00.000000000 Z
11
+ date: 2018-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler