active_object 1.0.3 → 1.0.4

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
  SHA1:
3
- metadata.gz: 0c35a60abef56e9ea9870c84558acaac13aa28ac
4
- data.tar.gz: 09f6b138d6cb164223cb7ebe9a92646a928ca52e
3
+ metadata.gz: 940333217ad9d26c8d0cef8b7ecc62a3479b4e11
4
+ data.tar.gz: e064aa1c1a918bff7c59324112621445c65bddb3
5
5
  SHA512:
6
- metadata.gz: 3d6d2c9eb4fe5c059c75394453b32c421f41632049d73779b18661b4132ee649e38bf38887b3e5c51d3757f51f9fc73a54fc9c0e3bb2269b423e77046080b46e
7
- data.tar.gz: 78eff913f5c5cd9bcb2389d8c19a48370516be2b9311224f7182fb60907645c0d1d3bdea3990ba3a698d12050c24c1053c9cec8ffa14c78afab88fe3a6f63f32
6
+ metadata.gz: ec8646c8b7b643153caac43f76e94b49b2c72194b84948084ceb0c9c649b5b81bc2b850490900fc167fc54e6fd83cb871056da9e8128fb97220d327130938ca3
7
+ data.tar.gz: 95837cb31b9e4e181e799357eb37ff8e9298537aa62040c1e01e94d1dfaee33cafc690c2879083e3644e0ecb0f0a72399e03432bcc92a5fdc7332860ff3f5ebb
@@ -39,14 +39,12 @@ class Numeric
39
39
  self + n
40
40
  end
41
41
 
42
- unless defined?(Rails)
43
- def bytes_in_bytes
44
- self
45
- end
46
-
47
- alias_method :byte_in_bytes, :bytes_in_bytes
42
+ def bytes_in_bytes
43
+ self
48
44
  end
49
45
 
46
+ alias_method :byte_in_bytes, :bytes_in_bytes
47
+
50
48
  def centigrams_in_grams
51
49
  self * CENTI
52
50
  end
@@ -105,28 +103,24 @@ class Numeric
105
103
  self / n
106
104
  end
107
105
 
108
- unless defined?(Rails)
109
- def exabytes_in_bytes
110
- self * EXABYTE
111
- end
112
-
113
- alias_method :exabyte_in_bytes, :exabytes_in_bytes
106
+ def exabytes_in_bytes
107
+ self * EXABYTE
114
108
  end
115
109
 
110
+ alias_method :exabyte_in_bytes, :exabytes_in_bytes
111
+
116
112
  def feet_in_inches
117
113
  self * FEET
118
114
  end
119
115
 
120
116
  alias_method :foot_in_inches, :feet_in_inches
121
117
 
122
- unless defined?(Rails)
123
- def gigabytes_in_bytes
124
- self * GIGABYTE
125
- end
126
-
127
- alias_method :gigabyte_in_bytes, :gigabytes_in_bytes
118
+ def gigabytes_in_bytes
119
+ self * GIGABYTE
128
120
  end
129
121
 
122
+ alias_method :gigabyte_in_bytes, :gigabytes_in_bytes
123
+
130
124
  def grams_in_grams
131
125
  self
132
126
  end
@@ -157,14 +151,12 @@ class Numeric
157
151
 
158
152
  alias_method :inch_in_inches, :inches_in_inches
159
153
 
160
- unless defined?(Rails)
161
- def kilobytes_in_bytes
162
- self * KILOBYTE
163
- end
164
-
165
- alias_method :kilobyte_in_bytes, :kilobytes_in_bytes
154
+ def kilobytes_in_bytes
155
+ self * KILOBYTE
166
156
  end
167
157
 
158
+ alias_method :kilobyte_in_bytes, :kilobytes_in_bytes
159
+
168
160
  def kilometers_in_meters
169
161
  self * KILO
170
162
  end
@@ -183,14 +175,12 @@ class Numeric
183
175
 
184
176
  alias_method :metric_ton_in_grams, :metric_tons_in_grams
185
177
 
186
- unless defined?(Rails)
187
- def megabytes_in_bytes
188
- self * MEGABYTE
189
- end
190
-
191
- alias_method :megabyte_in_bytes, :megabytes_in_bytes
178
+ def megabytes_in_bytes
179
+ self * MEGABYTE
192
180
  end
193
181
 
182
+ alias_method :megabyte_in_bytes, :megabytes_in_bytes
183
+
194
184
  def meters_in_meters
195
185
  self
196
186
  end
@@ -296,14 +286,12 @@ class Numeric
296
286
  ljust_count >= num_count ? string.ljust(ljust_count, pad_number.to_s) : string[0..(ljust_count - 1)]
297
287
  end
298
288
 
299
- unless defined?(Rails)
300
- def petabytes_in_bytes
301
- self * PETABYTE
302
- end
303
-
304
- alias_method :petabyte_in_bytes, :petabytes_in_bytes
289
+ def petabytes_in_bytes
290
+ self * PETABYTE
305
291
  end
306
292
 
293
+ alias_method :petabyte_in_bytes, :petabytes_in_bytes
294
+
307
295
  def positive?
308
296
  self > 0
309
297
  end
@@ -338,14 +326,12 @@ class Numeric
338
326
  self - n
339
327
  end
340
328
 
341
- unless defined?(Rails)
342
- def terabytes_in_bytes
343
- self * TERABYTE
344
- end
345
-
346
- alias_method :terabyte_in_bytes, :terabytes_in_bytes
329
+ def terabytes_in_bytes
330
+ self * TERABYTE
347
331
  end
348
332
 
333
+ alias_method :terabyte_in_bytes, :terabytes_in_bytes
334
+
349
335
  def to_byte(from, to)
350
336
  valid_keys = [
351
337
  :byte, :bytes,
@@ -1,3 +1,3 @@
1
1
  module ActiveObject
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  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: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez