lorem_ipsum_bio 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lorem_ipsum_bio.rb +35 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 450cee0c13ef0a0d34758883fb3eb547a45f82d1
4
- data.tar.gz: c716bfb70a936e5644a987120f3aebc7abdf970b
3
+ metadata.gz: 1dfd66e9c8acabf3eccc1f9d98d468bbb2bea0f8
4
+ data.tar.gz: c0e1ff93fd61db8503f67996ab8c9451f631ea00
5
5
  SHA512:
6
- metadata.gz: 747f9e005a95b75196f4db925919947a6f501c9c00028655483b70caa06a20ff7d2a3955972c7d51dc2a3373d85417d8df194a4601c8fbe1b1766072ea86a0e9
7
- data.tar.gz: 863b87d195ac2eef94e726ac08c859c2d19c1eefea732cdcac5150a2e2b1009211f78c227a054f288ce99550cb4285185f54e065ae445340d45d91e1a2bfa697
6
+ metadata.gz: 2e39051f36a84efb797b10d9c832e7185afd21b639c45c7896b14cd86414f2d8e3d964a77cef6d474e1027704ec0d98360d137719b95aeb64c9ca3355588fc81
7
+ data.tar.gz: e0c25dc1c43457710a3ccd6e55a437c2b533289f3947208ae9412504dbfff66187d94706ca782badccd902ca6fe3f415dbc7e7daecf05637398b9a9a4d39d115
@@ -1,4 +1,15 @@
1
+ # The main Lorem Ipsum Bio class
1
2
  class LoremIpsumBio
3
+
4
+ # Generate random string by sampling an array
5
+ #
6
+ # Example:
7
+ # >> LoremIpsumBio.random_string(3, ['a', 'b', 'c'])
8
+ # => "bac"
9
+ #
10
+ # Arguments:
11
+ # n: (Integer)
12
+ # a: (Array)
2
13
  def self.random_string(n, a)
3
14
  out_str = ''
4
15
  n.times { out_str << a.sample }
@@ -6,14 +17,38 @@ class LoremIpsumBio
6
17
  out_str
7
18
  end
8
19
 
20
+ # Generate random DNA fragment
21
+ #
22
+ # Example:
23
+ # >> LoremIpsumBio.random_DNA(3)
24
+ # => "TGA"
25
+ #
26
+ # Arguments:
27
+ # n: (Integer)
9
28
  def self.random_DNA(n)
10
29
  random_string(n, ['A', 'C', 'G', 'T'])
11
30
  end
12
31
 
32
+ # Generate random DNA fragment
33
+ #
34
+ # Example:
35
+ # >> LoremIpsumBio.random_RNA(3)
36
+ # => "UGA"
37
+ #
38
+ # Arguments:
39
+ # n: (Integer)
13
40
  def self.random_RNA(n)
14
41
  random_string(n, ['A', 'C', 'G', 'U'])
15
42
  end
16
43
 
44
+ # Generate random protein fragment
45
+ #
46
+ # Example:
47
+ # >> LoremIpsumBio.random_protein(3)
48
+ # => "WTF"
49
+ #
50
+ # Arguments:
51
+ # n: (Integer)
17
52
  def self.random_protein(n)
18
53
  random_string(n, ['A', 'C', 'D', 'E',
19
54
  'F', 'G', 'H', 'I',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lorem_ipsum_bio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Jankowski