liquefied 0.2.1 → 0.3.0

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
  SHA1:
3
- metadata.gz: d96f4666115e9d5349e0147a3a1b3007b5cf7f0c
4
- data.tar.gz: f894d0f8badcf1a4339bf6b9812435ad1e3803a8
3
+ metadata.gz: 6ec6060c88a9184f0da1c1a1edd0fe69ed17e7bf
4
+ data.tar.gz: 14a2b17dcb0a4fb810337de2333ce831067c3280
5
5
  SHA512:
6
- metadata.gz: 1455c52bc80eb0614583ec5dd6ee87364266b257e48ca57241fe22e9ad6e6544e8611105272e15fb35f9f7fa3d1ba5aa210cc983e2456b5c6114f83137f59ee9
7
- data.tar.gz: b78d7e6233cddf31a38b27e9a792fa05678a03cd70cbe42c97b0e9a81e888098b01f48896f03a3cdf1cc3e472f2c3ac161b9ba66bfd37b50aee302a1584b73d3
6
+ metadata.gz: 088a7820cc7dc5194ea7ff3b3d96ead14c4cf17ead994f0a282ad9256100b883e3022cab6d0933597288a08df086525b414adef1ba64277132fbe8a964a52bd0
7
+ data.tar.gz: 63cf1a10b5b38a45d3d8c54409af13dc3c37289e059a1d66a3ed8a2ad2a243b69ee9283cddb5eaa3becaaef4d909fd9c05c7b55dbe7ae960bc97778aaa383984
@@ -1,3 +1,3 @@
1
1
  class Liquefied < BasicObject
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/liquefied.rb CHANGED
@@ -2,6 +2,10 @@ require 'liquefied/version'
2
2
 
3
3
  class Liquefied < BasicObject
4
4
 
5
+ METHOD_ALIASES = [
6
+ [:to_s, :to_str]
7
+ ]
8
+
5
9
  # Public: Wrap an object with a default finalizer method
6
10
  #
7
11
  # The object remains wrapped and responds to all its original methods
@@ -38,7 +42,7 @@ class Liquefied < BasicObject
38
42
  private
39
43
 
40
44
  def method_missing(method, *args, &block)
41
- if method == @finalizer
45
+ if _finalizer?(method)
42
46
  _finalize!(*args, &block)
43
47
  else
44
48
  result = @original.public_send(method, *args, &block)
@@ -61,4 +65,10 @@ class Liquefied < BasicObject
61
65
  end
62
66
  end
63
67
 
68
+ def _finalizer?(method)
69
+ return true if method == @finalizer
70
+ both = [method, @finalizer]
71
+ METHOD_ALIASES.any? { |m| (m & both).size == 2 }
72
+ end
73
+
64
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquefied
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Vit
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-28 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -96,4 +96,3 @@ signing_key:
96
96
  specification_version: 4
97
97
  summary: Defer value formatting until output
98
98
  test_files: []
99
- has_rdoc: