omg-attrs 0.1.2 → 0.1.4

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: 02ce08d9a45a81a1e6e21af0744aadcac77ce59013fc4337860002a7001551e4
4
- data.tar.gz: 3a8048e24bec33c37d70c1ac73c0c8b6c62a2ced7fd8dde8042fef4904ab6f4f
3
+ metadata.gz: 8f5242d20de8f2253239d5f6ee6b119b5f4b6aafac735c25ae23d7356544837b
4
+ data.tar.gz: e874a1007387dc281f83606ef3258180ac6f9711549de94f4034cab321cb1ad8
5
5
  SHA512:
6
- metadata.gz: 4d060b165eb56a7dff83434896cbacbdb6ca0d031cabef97cfbf15b722c3ea4147b6b004918a544cbb72cf9e221626328cf0f5a8c9c4222ca674dfe2ae1a4ec1
7
- data.tar.gz: 822fb4378d650d8083c5bcd92b7c8057f80853a1b046270ceaa34d03c6b6ef097b24bc41fb75210008353fd4335a03bfa38d095906bc49d98188367d53ba6589
6
+ metadata.gz: b64c0922ed85ca40f71631a51515172f894565440f42a4a26a203a750601d790ba888fb6ed1bdf40fca37383ff15272c6338ebf4b7d1b7a5e990910a2767f0da
7
+ data.tar.gz: 483e9b78988c4ba7b3b527ed13f800401f1fb21207ec4b46b360bb16b2a2bae9485ec5a3fd2dd3236070c8acc0fe13257e6e4fac8011446864722ae7327f1f8d
data/lib/ext/array.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require_relative 'object'
2
+
1
3
  module Ext
2
4
  module Array
3
5
  ##
@@ -18,3 +20,4 @@ module Ext
18
20
  end
19
21
 
20
22
  Array.include Ext::Array
23
+ Array.include Ext::Object
data/lib/ext/hash.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require_relative 'object'
2
+
1
3
  module Ext
2
4
  module Hash
3
5
  def method_missing(method_name, *args, &block)
@@ -25,3 +27,4 @@ module Ext
25
27
  end
26
28
 
27
29
  Hash.include Ext::Hash
30
+ Hash.include Ext::Object
data/lib/ext/object.rb CHANGED
@@ -28,4 +28,4 @@ module Ext
28
28
  end
29
29
  end
30
30
 
31
- ::Object.include Ext::Object
31
+ Object.include Ext::Object
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'pry-byebug'
4
-
5
3
  module Attrs
6
4
  def self.included(base)
7
5
  base.include(InstanceMethods)
metadata CHANGED
@@ -1,26 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omg-attrs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Greenfield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-04 00:00:00.000000000 Z
11
+ date: 2024-09-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Makes it easy to slice and dice objects and collections of objects
13
+ description: |
14
+ - Adds `Object#attrs` method for querying nested attributes
15
+ - Adds `Array#where` to return a subset of elements matching a condition
16
+ - Adds `Array#find_by` to return the first element matching a condition
17
+ - Adds `Object#match?` to check if an object matches a condition
18
+ - Adds `Hash#method_missing` to allow {a: 1}.a instead of {a: 1}[:a]
14
19
  email:
15
20
  - mattgreenfield1@gmail.com
16
21
  executables: []
17
22
  extensions: []
18
23
  extra_rdoc_files: []
19
24
  files:
20
- - lib/attrs.rb
21
25
  - lib/ext/array.rb
22
26
  - lib/ext/hash.rb
23
27
  - lib/ext/object.rb
28
+ - lib/omg-attrs.rb
24
29
  homepage: https://github.com/omgreenfield/attrs
25
30
  licenses:
26
31
  - MIT
@@ -45,5 +50,5 @@ requirements: []
45
50
  rubygems_version: 3.5.17
46
51
  signing_key:
47
52
  specification_version: 4
48
- summary: Allows all objects to call `.attrs` which acts as a recursive `.slice` method
53
+ summary: Gives objects methods to query nested attributes
49
54
  test_files: []