store_as_int 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/store_as_int/base.rb +7 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67e0e708079f8b602ee41a17efaef8b7af9478d2235d888e1a0930c4529f040b
4
- data.tar.gz: bd04fa9baab51ae37b21f4d88ff16e3f1ed37e12c214f3f6a1c661a731542109
3
+ metadata.gz: f6b72bc34f16042d91c14899ff1aedbdfbec14bc8e4c70f79d6e9511afccae28
4
+ data.tar.gz: 432f5f3458d0315d129e58c2c3f9f7d1794e8d2bf3b13238e4de36b53ff8195a
5
5
  SHA512:
6
- metadata.gz: 119556737a075d197bef945399315e57a1ecbf6225cf5a2c5b461481f2575c83eff78a7575f9c44d9261590eee61a4844a2d50513f1e8396a5881c1ab57bb353
7
- data.tar.gz: 39d3b83b189a5a76a7f2d003c39885f84630c629b64373af5c499f05f7d06024a9905da7511b9c59b7f45991af7ae9c9f2e0b06bfa300c0bb72af38ecf79308a
6
+ metadata.gz: 4ea8dac641d4b63a2b14b97459f004a458b1e6df0e2607c29db5bba2a6daca31e15192bbf6c6ad941f072a3ad59ee709a0b84124e765f8de1c73af72fe22d896
7
+ data.tar.gz: f3cd3dd48ee061f9c6ad92947989d582a6b61bdb8d6aa63fd25b927732dfa1609d685045a21b50da2847be37404ce63951a13fd03affd03ea442a6aa7248d189
@@ -174,7 +174,11 @@ module StoreAsInt
174
174
 
175
175
  def method_missing(name, *args, &blk)
176
176
  if self.operators[name.to_sym]
177
- convert(value.__send__(name, convert(*args).value))
177
+ if args[0].kind_of?(self.class)
178
+ convert(value.__send__ name, args[0].value, *args[1..-1])
179
+ else
180
+ convert(value.__send__(name, convert(args[0]), *args[1..-1]))
181
+ end
178
182
  else
179
183
  ret = value.send(name, *args, &blk)
180
184
  ret.is_a?(Numeric) ? convert(ret) : ret
@@ -213,6 +217,7 @@ module StoreAsInt
213
217
  decimal: to_d,
214
218
  decimals: decimals,
215
219
  float: to_f,
220
+ int: to_i,
216
221
  str: to_s,
217
222
  str_format: str_format,
218
223
  str_matcher: matcher,
@@ -223,7 +228,7 @@ module StoreAsInt
223
228
  end
224
229
 
225
230
  def to_i
226
- value
231
+ value.to_i
227
232
  end
228
233
 
229
234
  def to_json(*args)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: store_as_int
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampson Crowley