skywalker 1.1.0 → 1.1.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: 3f6ceac6b8264295e36a783bfb010c99b1caa549
4
- data.tar.gz: 2705c927542812c9033a49957d37ed00a7a9cddf
3
+ metadata.gz: d19f8fad7236722932ae900e99b7c4aaf0b8a708
4
+ data.tar.gz: 1373707d67ae212131fa3f4ac95dda7d942831c1
5
5
  SHA512:
6
- metadata.gz: 93acfda6e3a9adf0516d804f206d234e5cf14efe338eb4abeef2bf810917e1bcdd9638c04545aad6823b4f5b275c48fafe40f93dea498c9161f800bbdc5fa6f7
7
- data.tar.gz: 6b1a5df15debb17a660a2fa92eb95ce14b8b555a056768b905245ac1491f46d6ea398ef5ab50f9221deef18ff736b3c9ceb51a47bdc0ef7931994b6479b69c95
6
+ metadata.gz: f877c39807cb3b1b7948786d484e018b176ad6ffd036b2da28ffcc5dd2464fee06ee8c3635a133f0cf088d32eda857b2d0301545a9f7f13cbe99013c39eeaf56
7
+ data.tar.gz: 83eb7c4d081624d25378e2723595a62757b13642c7ef8b184b51a1a4885e4fc0d34409a36930caa6243b52e642a61e0def5fa03d2b3d7ca8dc2941a8471cc7ec
@@ -14,12 +14,15 @@ module Skywalker
14
14
  # Instantiates command, setting all arguments.
15
15
  ################################################################################
16
16
  def initialize(**args)
17
- args.each_pair do |k, v|
17
+ args.each_pair do |reader_method, value|
18
+ writer_method = "#{reader_method}="
19
+
18
20
  singleton_class.class_eval do
19
- send(:attr_accessor, k) unless self.respond_to? k
21
+ send(:attr_reader, reader_method) unless respond_to?(reader_method)
22
+ send(:attr_writer, reader_method) unless respond_to?(writer_method)
20
23
  end
21
24
 
22
- self.send("#{k}=", v)
25
+ self.send(writer_method, value)
23
26
  end
24
27
  end
25
28
 
@@ -1,3 +1,3 @@
1
1
  module Skywalker
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -16,7 +16,17 @@ module Skywalker
16
16
  expect { Command.new(a_symbol: :my_symbol, a_string: "my string") }.not_to raise_error
17
17
  end
18
18
 
19
- it "sets an instance variable for each argument" do
19
+ it "sets a reader for each argument" do
20
+ command = Command.new(a_symbol: :my_symbol)
21
+ expect(command).to respond_to(:a_symbol)
22
+ end
23
+
24
+ it "sets a writer for each argument" do
25
+ command = Command.new(a_symbol: :my_symbol)
26
+ expect(command).to respond_to(:a_symbol=)
27
+ end
28
+
29
+ it "sets the instance variable to the passed value" do
20
30
  command = Command.new(a_symbol: :my_symbol)
21
31
  expect(command.a_symbol).to eq(:my_symbol)
22
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skywalker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Yurkowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-03 00:00:00.000000000 Z
11
+ date: 2014-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord