ooze-parser 0.1.7 → 0.1.8

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
- SHA1:
3
- metadata.gz: f3d6d9f5b2a81fc071bed9f32d21c65d07554beb
4
- data.tar.gz: 1ca9904ce21f3396a00ac70f290218ef9171d1c1
2
+ SHA256:
3
+ metadata.gz: 1883bd7308b1e95264ee71c5600508957c1599cdee0c3876170d357bbe6a27f5
4
+ data.tar.gz: 207722da6b7f6dbaa9439dfbb0681c5b6ca6598517f85a13bbb4ed06ad9b2067
5
5
  SHA512:
6
- metadata.gz: 1ee713e3cf2718b338ca141c5f400f1931ea97c06914fd23f0d376131fdb32300b1f54e049bbf53a7697c7fe111b70b946f98e74e3fae250c3f046c0d5085258
7
- data.tar.gz: dab2f8146b6a16a3096e1423b907aac2d863a18f8671e03ba6869681b9fe3e8bc2333a686e4a6f2b0ad9754a4112a3335a846e82112ed9ee4442e1df51e23563
6
+ metadata.gz: 4cbdb49a3044b071ccd5b651c6ab9ba4df5c269be139764ce7d6e8b3578eb130c12871a7894eec5181494c2afd74fbf90675d217abfae3507e7ecbb3337842e4
7
+ data.tar.gz: f250a71fdd094f1413a0bcc6a70f9c7a30e29bd321b0b02939b8361b8532cde455442cb6dfe77f29d499b6b78b041665b98ab206b45b8cab8dc6acdfe38a6c03
@@ -15,10 +15,10 @@ module Ooz
15
15
 
16
16
  private
17
17
 
18
- def to_hash(arr)
18
+ def to_hash(arr, key: "_id")
19
19
  raise "Sorry, expected Array, given: #{arr.class.name}" if !arr.is_a?(Array)
20
20
  arr.map do |e|
21
- [e._id, e]
21
+ [e.send(key), e]
22
22
  end.to_h
23
23
  end
24
24
 
@@ -6,6 +6,11 @@ module Ooz
6
6
  overridable_const :field_factory_class, Model::FieldFactory
7
7
  overridable_const :force_class, Model::Force
8
8
 
9
+ def tagged?(tag, search_on: :tags)
10
+ haystack = self.send(search_on)
11
+ haystack.include?(tag)
12
+ end
13
+
9
14
  def stages?
10
15
  evolution && evolution.stages&.length > 0
11
16
  end
@@ -35,8 +40,8 @@ module Ooz
35
40
  membranes
36
41
  end
37
42
 
38
- def fields_hash
39
- to_hash(fields)
43
+ def fields_hash(key: "_id")
44
+ to_hash(fields, key: key)
40
45
  end
41
46
 
42
47
  def sections
data/lib/ooz/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ooz
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ooze-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
@@ -140,8 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubyforge_project:
144
- rubygems_version: 2.6.14.1
143
+ rubygems_version: 3.0.4
145
144
  signing_key:
146
145
  specification_version: 4
147
146
  summary: ooze-parser to boost data integration and treatment