poodle 0.1.1 → 0.1.2

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: 0e12648cd9c73bc59748f9121931777441f62f3b
4
- data.tar.gz: 1ab71df4d25e2da28cc80829f2ba071be710b964
3
+ metadata.gz: 4a44516c255d6a096d8bdd899a76a1e38630af6e
4
+ data.tar.gz: d7c36e9301149525631513e1291b06107eb0db1c
5
5
  SHA512:
6
- metadata.gz: 661ff05ce37ca377e20570400f1903cafed1974813f34c5d28ab453b82b722e0665ed912ba8e4d15c34d82f7633c7a23c5d9e25dd28a670d0e492a79fff7ac41
7
- data.tar.gz: 8a69ee0df55fca6ef0d7521a8b94ab514ea7e7e1bc33107747616c4c018e51c5a1d8b77993ae0054bdfce5cee2b53336bbaa784663fd4fd6b94673c728087e9e
6
+ metadata.gz: f7dc658b3bead855d2911b9f95c0c572ccb4558cfa0cd6db73ad0c6f3b9f995a26c84b6b3a0fb3d93b9aa366e102373012d7c8e65a2958104f631dcb0014c921
7
+ data.tar.gz: 75e28bceb6867fed50278c6e6dc8745cc863fdab94f66816b34beb6cd6c02ef0b446a3dc8ea5a3496b239fb09eaaefb65d63917501e333119f923a89e42fe2c8
data/README.md CHANGED
@@ -22,7 +22,33 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ It gives you a combination of a pair of blood types given by using symbols. The symbols `:a`,`:b`,`:o` and `:ab` are available for blood types. If the `genotype` option is `true` (`false` by default), it returns an array of values in genotype format (`phenotype` by default).
26
+
27
+ ```Ruby
28
+ require 'poodle'
29
+
30
+ # By default, it returns an array of values described by the term "phenotype".
31
+ poodle = Poodle.new(:a, :b)
32
+ poodle.inherit
33
+ #=> ["AB", "A", "B", "O"]
34
+
35
+ # If the 'genotype' option is true,
36
+ # it returns an array of values described by the term "genotype".
37
+ poodle = Poodle.new(:a, :b, genotype: true)
38
+ poodle.inherit
39
+ #=> ["AB", "AO", "BO", "OO"]
40
+
41
+ # The 'inherit_with_rate' method returns a hash,
42
+ # a key/value pair of blood type and its probability.
43
+ poodle = Poodle.new(:a, :b)
44
+ poodle.inherit_with_rate
45
+ #=> {"AB"=>0.5625, "A"=>0.1875, "B"=>0.1875, "O"=>0.0625}
46
+
47
+ # It returns a collection of blood types in genetype.
48
+ poodle = Poodle.new(:a, :b, genotype: true)
49
+ poodle.inherit_with_rate
50
+ #=> {"AB"=>0.5625, "AO"=>0.1875, "BO"=>0.1875, "OO"=>0.0625}
51
+ ```
26
52
 
27
53
  ## Contributing
28
54
 
@@ -23,7 +23,7 @@ module Poodle
23
23
  if @genotype
24
24
  blood_combination.uniq
25
25
  else
26
- blood_combination.collect! { |e| to_phenotype(e) }.uniq
26
+ blood_combination.collect { |e| to_phenotype(e) }.uniq
27
27
  end
28
28
  end
29
29
 
@@ -1,3 +1,3 @@
1
1
  module Poodle
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["azukiwasher@higanworks.com"]
11
11
  spec.summary = %q{A Ruby interface to ABO blood group system.}
12
12
  spec.description = %q{A Ruby interface to ABO blood group system.}
13
- spec.homepage = ""
13
+ spec.homepage = "http://github.com/azukiwasher/poodle"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poodle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - azukiwasher
@@ -74,7 +74,7 @@ files:
74
74
  - poodle.gemspec
75
75
  - spec/poodle_spec.rb
76
76
  - spec/spec_helper.rb
77
- homepage: ''
77
+ homepage: http://github.com/azukiwasher/poodle
78
78
  licenses:
79
79
  - MIT
80
80
  metadata: {}