apple-data 1.0.652 → 1.0.653

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
  SHA256:
3
- metadata.gz: 3b572baee5af361bd153f67ea1b46426527743c6f7eb8f1b9afc5fd1bbcae5fe
4
- data.tar.gz: 24e8bb10e726e5b3b7ed69ee555e9603f72a44f43a05772c88946c6f1eaa45ac
3
+ metadata.gz: 482821ec962f4b074c21d5f0af855bb40a9c184abc02896489e825a882bafb65
4
+ data.tar.gz: d0f6b9232b2be836b4062ac088e75725437f703b093e7a511f1a9d9cc1c13e6e
5
5
  SHA512:
6
- metadata.gz: aa708ca902865bfb9cab22ceba83b0bfff3e13e659aa6f4d532ad3d7cdf9dbc413263a47255d4bbfb679c09bf5d14464370db04ebda4f33b4b7d9177b3e48bf7
7
- data.tar.gz: 80c1481f13ed5bce94eb83780f2e63c341af1dac23ee919e0924de1cddeaaa2fb9dda96e2a85eb109fff727944be36d4dae8e038e844951ea119c468096fcd92
6
+ metadata.gz: ce1b5bcdfc7b2484efe583a56d171dd2ef7b9c71774e60d51cdc08fae9e8c8cb7f14279f26f195d0a646643e5b0324ad8c6c569f6f1a69bc42c27283105043bb
7
+ data.tar.gz: f2d9137bbafb0ff882773a591bc98c73bfe4459a4933b3da1c70c0e7b36be78aad5219ec51197e7bfef16322a8c6f35ee9f7ae6f79c57c70a907298d0882567a
@@ -159,7 +159,7 @@ module AppleData
159
159
  [key, instance]
160
160
  end
161
161
 
162
- result.to_h
162
+ result.to_h.with_indifferent_access
163
163
  end
164
164
  end
165
165
  end
@@ -9,13 +9,21 @@ module AppleData
9
9
  @methods = {}
10
10
  end
11
11
 
12
- def collection(name, mapper = nil, &)
13
- @collections[name] = AppleData::DSL::CollectionDefinition.new(name, mapper)
14
- if block_given? && @collections[name].mapper.nil?
15
- @collections[name].mapper = Class.new(AppleData::SchemaBase)
16
- @collections[name].mapper.class_eval(&)
12
+ def collection(collection_name, mapper = nil, &)
13
+ data_collection_name = self.class.name
14
+ @collections[collection_name] = AppleData::DSL::CollectionDefinition.new(collection_name, mapper)
15
+ if block_given? && @collections[collection_name].mapper.nil?
16
+ @collections[collection_name].mapper = Class.new(AppleData::SchemaBase)
17
+ @collections[collection_name].mapper.const_set(:DATA_COLLECTION_NAME, data_collection_name)
18
+ @collections[collection_name].mapper.const_set(:COLLECTION_NAME, collection_name)
19
+ @collections[collection_name].mapper.instance_eval do
20
+ def name
21
+ "#{self.class.const_get(:DATA_COLLECTION_NAME)}:#{self.class.const_get(:COLLECTION_NAME)}"
22
+ end
23
+ end
24
+ @collections[collection_name].mapper.class_eval(&)
17
25
  end
18
- @collections[name]
26
+ @collections[collection_name]
19
27
  end
20
28
 
21
29
  def define_method(name, &proc)
@@ -15,6 +15,9 @@ AppleData::Schemas::PKI = AppleData::DataFile.define do
15
15
  end
16
16
 
17
17
  collection :oids do
18
+ attr_accessor :key
19
+
20
+ attribute :name, :string
18
21
  attribute :title, :string
19
22
  attribute :type, :string
20
23
  attribute :description, :string
@@ -22,5 +25,9 @@ AppleData::Schemas::PKI = AppleData::DataFile.define do
22
25
  attribute :found_in, :string, collection: true
23
26
  attribute :issuers, :string, collection: true
24
27
  attribute :ous, :string, collection: true
28
+
29
+ define_method :to_s do
30
+ [name, title, description, key].reject(&:blank?).first
31
+ end
25
32
  end
26
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppleData
4
- VERSION = '1.0.652'
4
+ VERSION = '1.0.653'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apple-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.652
4
+ version: 1.0.653
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Mark