eigindir 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/eigindir/api.rb +8 -2
- data/lib/eigindir/version.rb +1 -1
- data/spec/tests/eigindir_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24a9492c57c213577087d60572579217a45fe396
|
4
|
+
data.tar.gz: b8261b8ef108d9ca72605c75a87f1e8316d07de7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30eccc51870543bce60073bbaae098aa676e35d32aceec07ae5b33555fc07b205266d56c7beeaefb536d3f1bc1d2d8d65a43248fbe86ff886a170324d0b58b35
|
7
|
+
data.tar.gz: f9246a32e33ccf2f70fb2913bfd57c8b8c5f30cc7339960a6d883f46b009f10a319f5776a99e763eb82cb0260ffdd064d78949cbf6c34c53494bde507813de97
|
data/README.md
CHANGED
data/lib/eigindir/api.rb
CHANGED
@@ -53,11 +53,17 @@ module Eigindir
|
|
53
53
|
private
|
54
54
|
|
55
55
|
def __readers
|
56
|
-
@__readers ||=
|
56
|
+
@__readers ||= begin
|
57
|
+
default = superclass.send :__readers if superclass.is_a? Eigindir::API
|
58
|
+
default || []
|
59
|
+
end
|
57
60
|
end
|
58
61
|
|
59
62
|
def __writers
|
60
|
-
@__writers ||=
|
63
|
+
@__writers ||= begin
|
64
|
+
default = superclass.send :__writers if superclass.is_a? Eigindir::API
|
65
|
+
default || []
|
66
|
+
end
|
61
67
|
end
|
62
68
|
|
63
69
|
def __declare_reader(name, coercer)
|
data/lib/eigindir/version.rb
CHANGED
data/spec/tests/eigindir_spec.rb
CHANGED
@@ -52,6 +52,13 @@ describe Eigindir do
|
|
52
52
|
expect(subject).to eq({})
|
53
53
|
end
|
54
54
|
|
55
|
+
it "returns attributes defined in superclass" do
|
56
|
+
parent = Class.new { include Eigindir }
|
57
|
+
parent.attribute :foo, coerce: ->(_) { 1 }, strict: true
|
58
|
+
instance = Class.new(parent).new
|
59
|
+
expect(instance.attributes).to eq(foo: 1)
|
60
|
+
end
|
61
|
+
|
55
62
|
end # describe #attributes
|
56
63
|
|
57
64
|
describe "#attributes=" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eigindir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hexx-rspec
|