active_object 5.8.6 → 5.8.7

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: 19ebb3a20b688252d63058179a65548c7f12e67a5643ccd57a5f3a089c25be93
4
- data.tar.gz: 5ef7bd9ffd67b42dd44baf6448dfa0a7609d683eb6d8e2dc39dac5b92c2933f0
3
+ metadata.gz: b6b40bd57ea51c55d63f9fc6dce69d00e584694b585b62d092b9d0c4e80272ae
4
+ data.tar.gz: 46a27d84506b6380b858a460f08f2f5362eb18a39dd354e9d00bcecca1cb2124
5
5
  SHA512:
6
- metadata.gz: 128db4be9ba92d4565730120112fb48ab092b5f1f2f9defe330c9257676cd16442fb76f7cd3f69dd64db4ac079dbcfb9d92b27baa6ff98e6a1f1526f6d04c905
7
- data.tar.gz: a1a9cc7f6875888ac64b3d64455d1c0744a77b2ccedfbc90de8267442e3f367463a3affcd7c6aefdd2b2feb22590d9b2778b8a0ea4d1dc3d4785707ec45e16a6
6
+ metadata.gz: 25195c4fdef1de1b7a3903cc35f8005ddd6d7e1f006098988fade197a4850cfe09ea815f5a5ec9a44531f4ea3a7b0b57d0fdd088e247dc517ba5bf50046adb6d
7
+ data.tar.gz: 4114431acdea241350d2d605a4a96ae731c3277ff3c9ebb5d1cb83799069b1bc81ee91cf4c8d43942934bbfedd94fec5daf4fb82ab6e1193ae0adaab4c3b42db
data/README.md CHANGED
@@ -1657,6 +1657,15 @@ false.truthy? #=> false
1657
1657
  'example'.try(:fake_method) #=> nil
1658
1658
  ```
1659
1659
 
1660
+ **Try Send:**
1661
+ `try_send` execute caller to an object and rescues with nil.
1662
+
1663
+ ```ruby
1664
+ 3.safe_send(:fake) #=> nil
1665
+ 3.safe_send(:to_s) #=> '3'
1666
+ 3.safe_send(:+, 2) #=> 5
1667
+ ```
1668
+
1660
1669
  ## Range
1661
1670
 
1662
1671
  **Combine:**
@@ -125,6 +125,10 @@ module ActiveObject
125
125
  end
126
126
  end
127
127
 
128
+ def try_send(*keys)
129
+ send(*keys) rescue nil
130
+ end
131
+
128
132
  end
129
133
  end
130
134
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveObject
4
- VERSION ||= '5.8.6'
4
+ VERSION ||= '5.8.7'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.8.6
4
+ version: 5.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez