primalize 0.3.4 → 0.3.5

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
  SHA256:
3
- metadata.gz: 732b999e4ee12455d64ccf1b683bbb743091b7379358b9a1e5ac773a7291c0a1
4
- data.tar.gz: 014675a6a41e85d6d82a3c3e48b621016eb9582cc6d81655879dbaf5f96322b4
3
+ metadata.gz: 70326a3635d273a4784f118b93ffedd496b4b3fd1bd879f2bc3ad660dfd8727e
4
+ data.tar.gz: 5ba6145dc901fb14d9afdfa35ad65dd1676ae3db0d6f6151051a5c5ff87d3e7b
5
5
  SHA512:
6
- metadata.gz: f778b6a13b836a7d8099dff6b6de0fb3745e20372d1b7d373b76aa9e7f0924f0848256a8378249d3b7dbcad6eeeee8a324f609578a147aeca1278fd3f9aa1c6a
7
- data.tar.gz: 52cbddd5ebb3d3246d159c9ae5234e23fa2608ecb1a88902a05bcef2088dcc1abbd21938bf84e904b975741c722d7636c41d4187eee32ea55771be50c5adcbc0
6
+ metadata.gz: 73af1aadb7fd5db6ff75a23a6a9a9c12bbe4474395326caf376e92377f3cb23fc44fa3d84f86795700fc9bcf4cdec909cba47b92b5d33bc9619ffb7f3e63e824
7
+ data.tar.gz: e45fe5b42c49bcd31b3bacaee43cef89d561469d10881b2e6c4779ba136cb42cc49f81ba9b84b89f011b3efdba7251a3ea8ad050c015824e9d2ae30259d1c0c8
@@ -1,3 +1,5 @@
1
+ require 'json'
2
+
1
3
  module Primalize
2
4
  class Many
3
5
  def self.attributes attrs={}
@@ -9,13 +9,16 @@ module Primalize
9
9
  end
10
10
 
11
11
  class << self
12
+ def attributes **attrs
13
+ _attributes attrs
14
+ end
12
15
 
13
- def attributes attrs={}
14
- @attributes ||= if self.equal? Primalize::Single
15
- {}
16
- else
17
- superclass.attributes.dup
18
- end
16
+ def _attributes **attrs
17
+ @attributes ||= if self.equal? Primalize::Single
18
+ {}
19
+ else
20
+ superclass._attributes.dup
21
+ end
19
22
 
20
23
  add_attributes attrs
21
24
 
@@ -107,7 +110,7 @@ module Primalize
107
110
  end
108
111
 
109
112
  def call
110
- self.class.attributes.each_with_object({}) do |(attr, type), hash|
113
+ self.class._attributes.each_with_object({}) do |(attr, type), hash|
111
114
  value = public_send(attr)
112
115
 
113
116
  hash[attr] = if type === value
@@ -130,7 +133,7 @@ module Primalize
130
133
  end
131
134
 
132
135
  def csv_headers
133
- self.class.attributes.keys.map(&:to_s)
136
+ self.class._attributes.keys.map(&:to_s)
134
137
  end
135
138
 
136
139
  def to_csv
@@ -1,3 +1,3 @@
1
1
  module Primalize
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primalize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Gaskins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-24 00:00:00.000000000 Z
11
+ date: 2018-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler