genealogy 2.2.2 → 2.4.0

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: e3dda0154052e22f243b48bae114dae17b40b405c7968dcd59c2593c62e8862a
4
- data.tar.gz: e9d6368fe55759b49a8c67c7e45174cbe0ef94b607886036f8d5593ebe0c4101
3
+ metadata.gz: cdc120f7f9e2dcf06406a5ff6c0f9ff3e141479c30f7f25e6882003de83b6ba7
4
+ data.tar.gz: a7d8e6e2842288b654795134416882dcb9f84efea646d6808b24eef3638662f3
5
5
  SHA512:
6
- metadata.gz: f4bf0b82f01ca8e76631500314b288f50daa16d181c827dca08a8dbc9432f27d92da3b558a01c676b0196c072b02a880ae5aeaf3c99c851de52717759871b83f
7
- data.tar.gz: ce491f72110f4c82be25f4a0c881195864aa418891717d5766b437a1a684502b34c9b4ba5ca257c32290f2e4c4a553cf1975517e30ab82638a94bbaf48f4ae29
6
+ metadata.gz: aa770c140025e6f4a990302dcb804eed27de2c3aae987d83aefbb6c5fa7c51d4f4380f18c9194cce4a33d93c7432fc92d8d297dd38e8cc31db99a0d862ac0412
7
+ data.tar.gz: b40dbcdc590f93623e1836cd2de2aa0caa3f8ad0bc383e1a5c24f0023af75f20b6ff18d69f3f278bffc96f9d54a2a08fc79c77a403515f100084937b92a2ab7c
@@ -203,6 +203,22 @@ module Genealogy
203
203
  add_siblings(sibling,options)
204
204
  end
205
205
 
206
+ # @see #add_siblings
207
+ def add_paternal_half_siblings(*args)
208
+ options = args.extract_options!
209
+ options[:half] = :father
210
+ add_siblings(*args,options)
211
+ end
212
+
213
+ # @see #add_siblings
214
+ def add_maternal_half_siblings(*args)
215
+ options = args.extract_options!
216
+ options[:half] = :mother
217
+ add_siblings(*args,options)
218
+ end
219
+
220
+ alias :add_paternal_half_sibling :add_paternal_half_siblings
221
+ alias :add_maternal_half_sibling :add_maternal_half_siblings
206
222
 
207
223
  # remove siblings by nullifying parents of passed individuals
208
224
  # @overload remove_siblings(*siblings,options={})
@@ -241,6 +257,24 @@ module Genealogy
241
257
  remove_siblings(sib,options)
242
258
  end
243
259
 
260
+ # @see #remove_siblings
261
+ def remove_paternal_half_siblings(*args)
262
+ options = args.extract_options!
263
+ options[:half] = :father
264
+ remove_siblings(*args,options)
265
+ end
266
+
267
+ # @see #remove_siblings
268
+ def remove_maternal_half_siblings(*args)
269
+ options = args.extract_options!
270
+ options[:half] = :mother
271
+ remove_siblings(*args,options)
272
+ end
273
+
274
+ alias :remove_paternal_half_sibling :remove_paternal_half_siblings
275
+ alias :remove_maternal_half_sibling :remove_maternal_half_siblings
276
+
277
+
244
278
  # add children by assigning self as parent
245
279
  # @overload add_children(*children,options={})
246
280
  # @param [Object] children list of children
@@ -284,12 +284,14 @@ module Genealogy
284
284
  []
285
285
  when :include
286
286
  [:half_siblings]
287
+ when :include_separately
288
+ [:paternal_half_siblings, :maternal_half_siblings]
287
289
  when :father
288
290
  [:paternal_half_siblings]
289
291
  when :mother
290
292
  [:maternal_half_siblings]
291
293
  else
292
- raise ArgumentError, "Admitted values for :half options are: :father, :mother, :include, nil"
294
+ raise ArgumentError, "Admitted values for :half options are: :father, :mother, :include, :include_separately, nil"
293
295
  end
294
296
  roles += [:paternal_grandfather, :paternal_grandmother, :maternal_grandfather, :maternal_grandmother, :grandchildren, :uncles_and_aunts, :nieces_and_nephews, :cousins] if options[:extended] == true
295
297
  roles.inject({}){|res,role| res.merge!({role => self.send(role)})}
@@ -1,3 +1,3 @@
1
1
  module Genealogy
2
- VERSION = "2.2.2"
2
+ VERSION = "2.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genealogy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - masciugo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-19 00:00:00.000000000 Z
11
+ date: 2018-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord