epitools 0.5.33 → 0.5.34

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: 3ef87f5b481da8299d67f99558bdd36e980a1f01
4
- data.tar.gz: 8d0d98bb58b957051f1b8376ff748e4d08a7f88f
3
+ metadata.gz: f282bea8aea914ccdd0930cd854a7923843f735c
4
+ data.tar.gz: 5a62ed975b9862079425b8b32789533995dfaa85
5
5
  SHA512:
6
- metadata.gz: 08f077990e8518946eb3b0b0d30bc4f09b3daa867f386fa92ca183b38e5aa5c483ac1b8625ae9f7c2d6f95afe2e1a612fec68231d108f81fd0eb963f461a4989
7
- data.tar.gz: bca8a6f90958e61e8f3f371effdee9d2e80ca6bb4b6511416bf552330861ff23cf7d13029f5514fe1646aa91f5269652311eac73bc3d78b2ea1b0521951d787c
6
+ metadata.gz: 67e406669118cbeaa5538fc4edb530bc0407a3c066efc5e13f34b598219001ddb700cf3038087e21e055b146bcb8c699cc4a1812889c4d3b25ef02496c6e8c12
7
+ data.tar.gz: 13a943e596d4944fb5f2c81939f707773a2404a1c333f07362143aa9db8816f0ce42dec7c79e9129c279dd5117957fa499cad64211da43d521f207775dd9d8f6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.33
1
+ 0.5.34
@@ -60,8 +60,9 @@ class Object
60
60
  end
61
61
 
62
62
  #
63
- # Cache (memoize) the result of this method the first time it's called
64
- # and return this value for all subsequent calls.
63
+ # Cache (memoize) the result of an instance method the first time
64
+ # it's called, storing this value in the "@methodname" instance variable,
65
+ # and always return this value on subsequent calls.
65
66
  #
66
67
  def self.memoize(*methods)
67
68
  methods.each do |meth|
@@ -69,6 +70,7 @@ class Object
69
70
 
70
71
  if old_method.arity == 0
71
72
  ivarname = "@#{meth}"
73
+
72
74
  define_method meth do
73
75
  instance_variable_get(ivarname) or instance_variable_set(ivarname, old_method.bind(self).call)
74
76
  end
@@ -100,12 +102,6 @@ class Object
100
102
  pretty ? JSON::pretty_generate(self) : JSON.dump(self)
101
103
  end
102
104
 
103
- #
104
- # Proper grammar.
105
- #
106
- alias_method :is_an?, :is_a?
107
- alias_method :responds_to?, :respond_to?
108
-
109
105
  #
110
106
  # Emit a quick debug message (only if $DEBUG is true)
111
107
  #
@@ -131,6 +131,12 @@ class Object
131
131
  enum.include? self
132
132
  end
133
133
 
134
+ #
135
+ # Proper grammar.
136
+ #
137
+ alias_method :is_an?, :is_a?
138
+ alias_method :responds_to?, :respond_to?
139
+
134
140
  #
135
141
  # Instead of:
136
142
  # @person ? @person.name : nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epitools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.33
4
+ version: 0.5.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - epitron