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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a04b87646bc1711b3906a320357ff5c3a0ac6329
4
- data.tar.gz: e1e65a6867902d0a8b6ad1a6a1c80bd53a1e9db9
3
+ metadata.gz: 24a9492c57c213577087d60572579217a45fe396
4
+ data.tar.gz: b8261b8ef108d9ca72605c75a87f1e8316d07de7
5
5
  SHA512:
6
- metadata.gz: 0a815b9c785c79e92b18add69df7bccd7f323391daf508b0e5ffdb24678256e1fb16b3ca426b2e289713660f41874bee71f88f788137f0a4da04ea7d2c0f549a
7
- data.tar.gz: b519e53fcab8f5375bd9f508400af912b63ba5f534cd838ef67c49c258cb73e06ebea0a2ee4e59ba4e6e1aaa82db4bb718b0f144303f7356cc6e18d68700f0a5
6
+ metadata.gz: 30eccc51870543bce60073bbaae098aa676e35d32aceec07ae5b33555fc07b205266d56c7beeaefb536d3f1bc1d2d8d65a43248fbe86ff886a170324d0b58b35
7
+ data.tar.gz: f9246a32e33ccf2f70fb2913bfd57c8b8c5f30cc7339960a6d883f46b009f10a319f5776a99e763eb82cb0260ffdd064d78949cbf6c34c53494bde507813de97
data/README.md CHANGED
@@ -229,7 +229,7 @@ foo.bar # => "11"
229
229
 
230
230
  ### Coersion of nil
231
231
 
232
- Because +nil+ stands for pure nothing, it is not coerced by default:
232
+ Because `nil` stands for *nothing*, it is not coerced by default:
233
233
 
234
234
  ```ruby
235
235
  class Foo
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)
@@ -4,6 +4,6 @@ module Eigindir
4
4
 
5
5
  # The semantic version of the module.
6
6
  # @see http://semver.org/ Semantic versioning 2.0
7
- VERSION = "0.0.1".freeze
7
+ VERSION = "0.0.2".freeze
8
8
 
9
9
  end # module Eigindir
@@ -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.1
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-28 00:00:00.000000000 Z
11
+ date: 2015-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hexx-rspec