state_inspector 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91381367b1700878be9583f54504f203f15175ca
4
- data.tar.gz: 22dc94bacd8aaaec80b95fdd6277730dcbbcec47
3
+ metadata.gz: d5cb038068fa7183077900d356b5986a9b2ddf48
4
+ data.tar.gz: 208d426f3459f1d5d3002f5a402d800da5bdb8f0
5
5
  SHA512:
6
- metadata.gz: c5ef7d1e269c4874c8a7c9c937c8ce649a1d23e27797def648fb73d20c91ab3e81862199392d60b40181db1ac202931d216f3c7a984d63334ed02a21de4100bd
7
- data.tar.gz: c066d620a79f942ef71fe8ffe84962bddf143d75c841f170351d970e1029f929c1c409346f54501b18acddc23facd5a9721e3a59a3afdf3b63a5cf0ce18004e7
6
+ metadata.gz: 89702420071e816b9e4ad58a83506df05c7065eb2b825e77ecded1003c32baac84207fd6bd738b0e8b402e948c4ddaa7b3230fb5440713631d2e8aff52c92265
7
+ data.tar.gz: f49460d203703dda01715a0eee99bbb2026a2a38760e672aade3060fc524a9c65158d6bf05072fa2201bd94482151b07d5b192d14ca01c3f55c217f881bef4bc
data/README.md CHANGED
@@ -54,8 +54,8 @@ of the object, method, old value, and new value. So you will see what is change
54
54
  the order that the changed occurred. This session logger will grab as many objects state changes
55
55
  as you want and give you a nice ordered history of what has occurred.
56
56
 
57
- If you don't want to inform on all instances of one class then instead of running `toggle_informant`
58
- on the class then execute that method on just the instances of that class you want instead.
57
+ If you don't want to inform on all instances of a class then instead of running `toggle_informant`
58
+ on the class itself then simply execute that method on the instances you want to observe.
59
59
 
60
60
  If you want to see the expected results of the current observer/reporters then see [test/reporter_test.rb](https://github.com/danielpclark/state_inspector/blob/master/test/reporter_test.rb).
61
61
 
@@ -109,7 +109,7 @@ end
109
109
  And to register this observer to a target class you simply write:
110
110
 
111
111
  ```ruby
112
- StateInspector::Reporter[MyTargettedClass] = ExampleObserver
112
+ StateInspector::Reporter[MyTargetClass] = ExampleObserver
113
113
  ```
114
114
 
115
115
 
@@ -7,23 +7,27 @@ module StateInspector
7
7
  base.include ClassMethods
8
8
  end
9
9
 
10
- def attr_writer attr_name
11
- define_method("#{attr_name}=") do |value|
12
- tell_si __method__.to_s.chop,
13
- instance_variable_get("@#{attr_name.to_s}"),
14
- value
15
-
16
- instance_variable_set("@#{attr_name.to_s}", value)
10
+ def attr_writer *attr_names
11
+ attr_names.each do |attr_name|
12
+ define_method("#{attr_name}=") do |value|
13
+ tell_si __method__.to_s.chop,
14
+ instance_variable_get("@#{attr_name.to_s}"),
15
+ value
16
+
17
+ instance_variable_set("@#{attr_name.to_s}", value)
18
+ end
17
19
  end
18
20
  nil
19
21
  end
20
22
 
21
- def attr_accessor attr_name
22
- define_method("#{attr_name}") do
23
- instance_variable_get("@#{attr_name.to_s}")
24
- end
23
+ def attr_accessor *attr_names
24
+ attr_names.each do |attr_name|
25
+ define_method("#{attr_name}") do
26
+ instance_variable_get("@#{attr_name.to_s}")
27
+ end
25
28
 
26
- self.attr_writer(attr_name)
29
+ self.attr_writer(attr_name)
30
+ end
27
31
  end
28
32
 
29
33
  module ClassMethods
@@ -1,3 +1,3 @@
1
1
  module StateInspector
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_inspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel P. Clark
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-19 00:00:00.000000000 Z
11
+ date: 2017-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler