eitil 0.3.9 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac7bd5bff2af923e06936b0016f4f07f8d4eba225a68dc193bdf5f277bcdbb97
4
- data.tar.gz: 193b41fa2a5fde545b189b79a2c94328c242bf45d71ff5802cfab3fb7b95c402
3
+ metadata.gz: 0a5f03357f8feee5c40fa17fdf11acc544229eb85e822578929d18bab25f5ec4
4
+ data.tar.gz: 32ecc96ed0088b7a447fac59505d76e1f5c0e4131b38a615b2ccdf6bdbdf4b13
5
5
  SHA512:
6
- metadata.gz: 52c86de08e26441922852f3cd5563a36ac46c585a3ab50745e1f0fc2dacf9dc6187574f54c7c33ba415fdd3be006e0c45b7245076b209fd74a3782b07c1ace34
7
- data.tar.gz: 0bf06bc0226924db17b2c9b7f9138eac75116cb4d351fe9818690f2745cfaa68d43eac837dbfb0825b6870eeeb0ab4b50cb091ed05243b533501498d8ca60eac
6
+ metadata.gz: 706798e2c7e5e1f81cd413a5698fa030eedcc606dae5a2a6ade7fd74bc21cfa1e485cc3a7c782097aa7cac2271d879f91e8d0791627540df9acd03e8bc873273
7
+ data.tar.gz: c33996734e261cc3419ad9dfcec4dd271ecb40be39cc0dac2ae44156f750329a179a3988ba0a4d574a27fa8d411b1542f230c566544d9bb67ef4f6c60d93dc1a
data/README.md CHANGED
@@ -130,6 +130,17 @@ auto_dig(_hash = self, _key)
130
130
 
131
131
 
132
132
 
133
+ ## Float
134
+
135
+ ```ruby
136
+ safe_to_i
137
+ # converts a float to an integer, only when no decimal values are lost.
138
+ # 8.00.safe_to_i returns 8 (Integer)
139
+ # 8.88.safe_to_i returns 8.88 (Float)
140
+ ```
141
+
142
+
143
+
133
144
  ## ApplicationController
134
145
 
135
146
  ```ruby
@@ -0,0 +1,9 @@
1
+ class Float
2
+
3
+ # converts a float to an integer, only when no decimal values are lost.
4
+
5
+ def safe_to_i
6
+ self == self.to_i ? self.to_i : self
7
+ end
8
+
9
+ end
data/lib/eitil/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eitil
2
- VERSION = '0.3.9'
2
+ VERSION = '0.3.10'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eitil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurriaan Schrofer
@@ -59,6 +59,7 @@ files:
59
59
  - config/initializers/monkeys/application_controller.rb
60
60
  - config/initializers/monkeys/application_record.rb
61
61
  - config/initializers/monkeys/date_time.rb
62
+ - config/initializers/monkeys/float.rb
62
63
  - config/initializers/monkeys/hash.rb
63
64
  - config/initializers/monkeys/kernel.rb
64
65
  - config/initializers/monkeys/module.rb