getth 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/getth.rb +4 -16
  3. metadata +19 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de1f1ce9f19a0ff47f904bfbf0044320546de3a3
4
- data.tar.gz: 133ee571ec73b4057356cc7db92abe4fa5628b00
3
+ metadata.gz: 6d5c4264706b60b462682d939065703143ab10e5
4
+ data.tar.gz: 218a559f620b72c5ce015fbc343c6ec002c42530
5
5
  SHA512:
6
- metadata.gz: 30a3d1aaaf575cb35a9cc5da187f38d8ced0196ad543e9d2b479a98476d0066b3161f4cf85ae2e4fd947077842c3ac8f574315105ac3e5b310174ea2f3749bd8
7
- data.tar.gz: 05fb670f42f65e120d0f9f01a0b8342383e1f2eb4a9476d6fa00546ae27545fa8aa216eda669d65a748484cf3d1987a33e1f4c07da83d874e92fb5422a2462f6
6
+ metadata.gz: 731a3c0cf41bfed8223523664ddb8c1190244d43f309d14440aa1a03d5b92c84d3eb41887e51daf78dc9d23b36219319012a86ed2bc101cb1a392559a3439294
7
+ data.tar.gz: 971cfdb2632ae73c80967fc2242ad52606d6c10627dd87276c1d4941680162dd7869845065cfb62e87f01c64dfcff5e74507fc6c85f987c119c15e4a754619cb
@@ -1,27 +1,15 @@
1
1
  require 'ordinalize'
2
2
 
3
3
  module Getth
4
- #defines methods 'second', 'third'...'tenth' for retrieving values from strings/arrays
5
- (2..10).each do |i|
4
+ (1..10).each do |i|
6
5
  define_method(i.ordinalize) { self[i.pred] }
7
6
  end
8
7
  end
9
8
 
10
9
  class Array
11
- include Getth
10
+ include Getth
12
11
  end
13
12
 
14
13
  class String
15
- include Getth
16
- end
17
-
18
- =begin
19
-
20
- ###########Example#############
21
- arr = (1..10).to_a.shuffle => [9, 2, 7, 10, 3, 8, 4, 1, 5, 6]
22
- arr.second => 2
23
- arr.third => 7
24
- arr.fourth => 10
25
- arr.tenth => 6
26
- "Hello".second => "e"
27
- =end
14
+ include Getth
15
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getth
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
  - Sagar Pandya
@@ -9,9 +9,24 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2017-01-19 00:00:00.000000000 Z
12
- dependencies: []
13
- description: Extends Array and String classes to access indexed-elements from an object
14
- using first, second,...,ninth and tenth.
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ordinalize
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: This gem defines methods _first, second, third ... ninth, tenth_ for
28
+ retrieving values from strings and arrays. The Array and String classes are monkey-patched
29
+ with the module Getth.
15
30
  email: sarg@outlook.com
16
31
  executables: []
17
32
  extensions: []