dynarex 1.5.30 → 1.5.31

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: 96ec801998f91ebcc22dc57f9b16a533ef9c7434
4
- data.tar.gz: 1f464ee3d5adae045bb0052ade53f735d4c3867d
3
+ metadata.gz: db34f474e385f85427193dd5a21a6f2b31f77dc1
4
+ data.tar.gz: c7fcfcb05df3c616605973d7212c822d5c4e8277
5
5
  SHA512:
6
- metadata.gz: 6223229362cfa0862fea0fb9f1bc4d5b74391c91ea551ac04164e3a7daf7bd2330277e23e389f1400dee981bf4a80e78536310a2765ff5d9fc3f48ef06c35a3d
7
- data.tar.gz: efeebe527c2ddaf20012c31fe7b8012ed4dc556f1f21f3657c8682655f50e6d8c492a734e732c119522957d65ab78d2f96b5b5c8298754f2b2515b05fe1739dd
6
+ metadata.gz: b6783b0af87fb256776e9954e48be98b75cb2044e0bba430eeadbb7f8c3550bb55cf61dbd794904e1aa3cee38beffc7e0968b84b0709b43f7213bebaf158cf42
7
+ data.tar.gz: 0cb6faf8a7507e0807750c3e1d2f1f242521117ab6283fa01703ebf05765b3ead0be0a6a681a9ba4ca4d8c4e866c1e792220a115493173bddc555f897a66b2ca
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -169,9 +169,29 @@ class Dynarex
169
169
 
170
170
  # Returns a ready-only snapshot of records as a simple Hash.
171
171
  #
172
- def flat_records
172
+ def flat_records(select: nil)
173
+
174
+ fields = select
175
+
173
176
  load_records if @dirty_flag == true
174
- @flat_records
177
+
178
+ if fields then
179
+
180
+ case fields.class.to_s.downcase.to_sym
181
+ when :string
182
+ field = fields.to_sym
183
+ @flat_records.map {|x| x[field]}
184
+ when :symbol
185
+ field = fields
186
+ @flat_records.map {|x| x[field]}
187
+ when :array
188
+ fields.map {|field| @flat_records.map {|x| x[field.to_sym] } }
189
+ end
190
+
191
+ else
192
+ @flat_records
193
+ end
194
+
175
195
  end
176
196
 
177
197
  alias to_h flat_records
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.30
4
+ version: 1.5.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  zafTuKRozNy5wCw7Z32VaDGcJ+yTPq73CrcPrNyaoxqGfU0qNsh6oGvwrq4Q1k4j
32
32
  Pz2GWE7KigXTBg==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-07-03 00:00:00.000000000 Z
34
+ date: 2015-07-06 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: dynarex-import
metadata.gz.sig CHANGED
@@ -1 +1,3 @@
1
- 9�أ������A�j��S����Yb[]:yH��-V����5�Ðxu���[U�bC�����*��w������"�Z��p��"ɂdz(��y����-S�)$o��� vݾ���CKG�M'YB�G$��m4�x�Y��iI���ܕ����nc�AV}�I�I/!7��
1
+ �������+��IJ/�I}�\|x������i-�m����G�FDsL9��v��b
2
+ d����ORSt�2����������޻�̈́��\����8$�D*
3
+ ��3T.�ݏ5G�9�'D��3�w�iÇ��]������'�0���"��P�K��O��)ړ�v�J>�3�� qcJh�ɗ+0�]�b���M���1�TYnൈ�*�Q�b�P8eń]�s?����痼�޵�Dt6�j9���թ%R��!