schemad 1.2.3 → 1.2.4

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: c365fd42508eefbf5df2f46504c0a12ecdda0a02
4
- data.tar.gz: 72dc0e423ede9244418d7c1df9a3405d51b2ccfe
3
+ metadata.gz: ddae899acf7c8752a931a4f42637d86e0b4941cd
4
+ data.tar.gz: 8d926f79a6935fe3eadac9f12f21d4f7810cf576
5
5
  SHA512:
6
- metadata.gz: 8e6b7c4c4557ed40b1ae2236b032ec9e24c6c33741ea979c641bca682ac4c1305eb3596a85151830be4a54ce4ddbb129325c653c162020a9af76e71a6a234af1
7
- data.tar.gz: 31e85397afe6b80b73ad7f3894ee12402f24c0e3e34ed99da6037f7499fff0ceb2672ce7927c5d07bf967fa92012e61f69737f29953ec05b00dce011544645aa
6
+ metadata.gz: 44806823a7ac528ab03d8e89ac97facb1fa93757512c26e9b38589e0721be0380a0cdc57d583fc9cdece8d0ed0acde559458d4998875f02973c19185e309db37
7
+ data.tar.gz: 5fa5dbf63f86e0f0416fa4bc73bb4ca2959866c1738cc0f4482cdae1e841e8d04d4776c7ede494d824405c8d1e8b150679230738742585d3545bf5dda7547705
@@ -31,8 +31,12 @@ module Schemad
31
31
  obj
32
32
  end
33
33
 
34
+ def self.attribute_names
35
+ @attributes
36
+ end
37
+
34
38
  def attribute_names
35
- self.class.instance_variable_get(:@attributes)
39
+ self.class.attribute_names
36
40
  end
37
41
 
38
42
  def to_hash
@@ -1,3 +1,3 @@
1
1
  module Schemad
2
- VERSION = "1.2.3"
2
+ VERSION = "1.2.4"
3
3
  end
data/spec/entity_spec.rb CHANGED
@@ -16,6 +16,20 @@ describe Schemad::Entity do
16
16
  beasts: "1337"
17
17
  }}
18
18
 
19
+ context "introspection" do
20
+ Given(:fields) { %i[forest roads beasts world cool created] }
21
+
22
+ context "on class" do
23
+ When(:attrs) { Ent.attribute_names }
24
+ Then { attrs.should == fields }
25
+ end
26
+
27
+ context "on instance" do
28
+ When(:attrs) { Ent.new.attribute_names }
29
+ Then { attrs.should == fields }
30
+ end
31
+ end
32
+
19
33
  context "#from_data" do
20
34
  Given(:ent) { Ent.from_data(normal_data) }
21
35
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schemad
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke van der Hoeven
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-10 00:00:00.000000000 Z
11
+ date: 2015-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport