object_pick 1.0.0

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 +7 -0
  2. data/lib/object_pick.rb +8 -0
  3. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0e1c40c347aa03c4c198047b1f4629413261b951105f750ad5ad9ce93d015650
4
+ data.tar.gz: f18c0b514215a240a58f928d4d268d8e5db275dfc4c495a3ae3f2af18c915184
5
+ SHA512:
6
+ metadata.gz: b19b8c130af4602dda3d58d05a214864b9dba0c214c82a83dbe10a9a701c93ac2f4c6da94bf0305a6b40cabcff17bcf3c8afd5b266a96d1f0eb8fd48c9a8da9c
7
+ data.tar.gz: dc61e551a5aa483850d0d00108efa88054a2e29b67124cbea6e33b708eacd464132ce7692430c8ca7b111873249b336312b58742d7f1a82cf123ee49214527cb
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Adds `Object#pick` to extract a hash of method results from any object
4
+ class Object
5
+ def pick(*methods)
6
+ methods.to_h { [_1, public_send(_1)] }
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: object_pick
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Aaron Rosenberg
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: Adds `Object#pick`.
13
+ email: aarongrosenberg@gmail.com
14
+ executables: []
15
+ extensions: []
16
+ extra_rdoc_files: []
17
+ files:
18
+ - lib/object_pick.rb
19
+ homepage: https://github.com/agrberg/object_pick
20
+ licenses:
21
+ - MIT
22
+ metadata:
23
+ rubygems_mfa_required: 'true'
24
+ source_code_uri: https://github.com/agrberg/object_pick
25
+ bug_tracker_uri: https://github.com/agrberg/object_pick/issues
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '3.3'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.6.9
41
+ specification_version: 4
42
+ summary: Extract a hash of method results from any object.
43
+ test_files: []