interchangeable 0.0.2 → 0.0.3

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: 5df0ea6a13cdf08bf9339d7933cb1a6765a4f383
4
- data.tar.gz: 9835d7d3a325ea760ccb587486a77bd1bb8e1713
3
+ metadata.gz: 1bcdfc0e991f5e031d0aaf71b7b400ef9fbd1898
4
+ data.tar.gz: ad3ab4c86e1d49bc83c77bfc1a8d863650839455
5
5
  SHA512:
6
- metadata.gz: 7e3ac3cfd0390ef4900a94ead1bf8f5b696a9ee12237de563f78e0ac21d9093023d1805b98741bc8554740fda20903940c3b268cb4a5de43eac4e1fa2d0b97aa
7
- data.tar.gz: d231000374e534a5b5f773e357a184ae1ddce695f91c4a3ea4d6035270707e996691bad2789569cfd3f670132b8dd9e871ee89fe42515b556afe7bea580c7a8b
6
+ metadata.gz: bbfd378812d261597c0ac4687a6cd042213179249d74c85c1ec6a840b904a522a7b99c86cc9b2fdb503cadc11d1cd752ac5e9d79c481d17d2aece003ee8a0196
7
+ data.tar.gz: 0c4153e30f694cc19c61aeeba39ea2cb541d6ff429ecc980883892c3b290146d7d9f3a237771b358e94605231fcfa8ba10c630946311770a36e661b1e8ba92a2
@@ -11,7 +11,7 @@ class Class
11
11
  @interchangeable_description = nil
12
12
  entry = Struct.new(:method_name, :target, :implemented, :default, :description)
13
13
  .new(args[0], self, false, false, description)
14
- Interchangeable.entries << entry
14
+ Interchangeable.methods << entry
15
15
  if block
16
16
  Interchangeable.define self, args[0], &block
17
17
  entry.default = true
@@ -23,8 +23,8 @@ module Interchangeable
23
23
 
24
24
  class << self
25
25
 
26
- attr_accessor :entries
27
- def entries
26
+ attr_accessor :methods
27
+ def methods
28
28
  @settings ||= []
29
29
  end
30
30
 
@@ -32,7 +32,7 @@ module Interchangeable
32
32
  the_class.instance_eval do
33
33
  define_method method_name, &block
34
34
  end
35
- entry = Interchangeable.entries.select { |x| x.target == the_class && x.method_name && method_name }.first
35
+ entry = Interchangeable.methods.select { |x| x.target == the_class && x.method_name && method_name }.first
36
36
  entry.implemented = true
37
37
  entry.default = false
38
38
  end
@@ -1,3 +1,3 @@
1
1
  module Interchangeable
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -22,30 +22,30 @@ describe Interchangeable do
22
22
  end")
23
23
  end
24
24
 
25
- describe "entries" do
25
+ describe "methods" do
26
26
 
27
27
  it "should create an entry" do
28
- Interchangeable.entries.count.must_equal 1
28
+ Interchangeable.methods.count.must_equal 1
29
29
  end
30
30
 
31
31
  it "should include the method name" do
32
- Interchangeable.entries.first.method_name.must_equal example.method_name.to_sym
32
+ Interchangeable.methods.first.method_name.must_equal example.method_name.to_sym
33
33
  end
34
34
 
35
35
  it "should return the target" do
36
- Interchangeable.entries.first.target.must_equal eval(example.class_name)
36
+ Interchangeable.methods.first.target.must_equal eval(example.class_name)
37
37
  end
38
38
 
39
39
  it "should say that it is not implemented" do
40
- Interchangeable.entries.first.implemented.must_equal false
40
+ Interchangeable.methods.first.implemented.must_equal false
41
41
  end
42
42
 
43
43
  it "should say that it is not using the default implementation" do
44
- Interchangeable.entries.first.default.must_equal false
44
+ Interchangeable.methods.first.default.must_equal false
45
45
  end
46
46
 
47
47
  it "should include the description" do
48
- Interchangeable.entries.first.description.must_equal example.description
48
+ Interchangeable.methods.first.description.must_equal example.description
49
49
  end
50
50
 
51
51
  end
@@ -65,11 +65,11 @@ describe Interchangeable do
65
65
  end
66
66
 
67
67
  it "should say that it is not implemented" do
68
- Interchangeable.entries.first.implemented.must_equal true
68
+ Interchangeable.methods.first.implemented.must_equal true
69
69
  end
70
70
 
71
71
  it "should say that it is not using the default implementation" do
72
- Interchangeable.entries.first.default.must_equal false
72
+ Interchangeable.methods.first.default.must_equal false
73
73
  end
74
74
 
75
75
  end
@@ -130,11 +130,11 @@ describe Interchangeable do
130
130
  end
131
131
 
132
132
  it "should say that it is implemented" do
133
- Interchangeable.entries.first.implemented.must_equal true
133
+ Interchangeable.methods.first.implemented.must_equal true
134
134
  end
135
135
 
136
136
  it "should say that it is using the default implementation" do
137
- Interchangeable.entries.first.default.must_equal true
137
+ Interchangeable.methods.first.default.must_equal true
138
138
  end
139
139
 
140
140
  describe "and a new implementation is define elsewhere" do
@@ -155,7 +155,7 @@ describe Interchangeable do
155
155
  end
156
156
 
157
157
  it "should reset the default flag to false" do
158
- Interchangeable.entries.first.default.must_equal false
158
+ Interchangeable.methods.first.default.must_equal false
159
159
  end
160
160
 
161
161
  end
@@ -180,8 +180,8 @@ describe Interchangeable do
180
180
  end
181
181
 
182
182
  it "should put the description on the first, but not the second" do
183
- Interchangeable.entries[0].description.must_equal "That's a banana"
184
- Interchangeable.entries[1].description.nil?.must_equal true
183
+ Interchangeable.methods[0].description.must_equal "That's a banana"
184
+ Interchangeable.methods[1].description.nil?.must_equal true
185
185
  end
186
186
  end
187
187
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interchangeable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Cauthon