primitive_wrapper 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +7 -3
- data/lib/primitive_wrapper.rb +2 -2
- data/lib/primitive_wrapper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 306534906d2db587ee4ee03aaa62a62350002af523fd45be799c3bb59b57ced4
|
4
|
+
data.tar.gz: 8053032cd490a4e5c4148f465e3cbc28d64634ee41316fc14bf332c3fc3ba512
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d12c707a283d304ae5b3702e7f5c1a583bdb440878c7f0b08ae04f23c4a11e29862abc80c5e0e656b1961816917869347d076187c38f6f866637063553e86141
|
7
|
+
data.tar.gz: 2c449b2960dd9fa28cd390dce246f19dbb261d0a0330d8125f8f9c36e7a2fd2b0171ddb79d6c4b683c2ba715310a13481d1ce73a63168d24ea97616968225b1c
|
data/README.md
CHANGED
@@ -35,7 +35,7 @@ Or try it out inside irb:
|
|
35
35
|
## Usage
|
36
36
|
|
37
37
|
There are 12 wrapper classes that hold these pesky primitive literal objects.
|
38
|
-
Unlike other class objects, these primitives have no constructor and attempt to look
|
38
|
+
Unlike other class objects, these primitives have no constructor and attempt to look like the bottom turtle literals used in compiled languages like C/C++.
|
39
39
|
Such primitive literals are completely immutable. The wrappers used in this gem transform these primitive types into mutable objects.
|
40
40
|
In fact, these objects cannot be frozen as that would defeat their purpose. The freeze method on these wrapper classes is disabled.
|
41
41
|
The wrapped literal now behaves like a true ruby object such as Array, or Hash.
|
@@ -424,7 +424,7 @@ abc.defined_properties! # [] ... you just zapped the entire hash after abc
|
|
424
424
|
# :~ :unwrap :val :prim_value ... returns internal hash
|
425
425
|
# :val= :replace ... assigns new hash to wrapper
|
426
426
|
# :[] :[]= ... access internal hash element
|
427
|
-
# :deferred? key ... true if key
|
427
|
+
# :deferred? key ... true if key is in internal hash but will not create a property access variable
|
428
428
|
# :property? key ... true if key is registered as a property access variable
|
429
429
|
# :split! ... returns an array of two Hash instances with [valid_property_hash, deferred_hash]
|
430
430
|
# :rekey! ... rekeys property and deferred keys ... called internally
|
@@ -617,7 +617,11 @@ So it is left to you to decide.
|
|
617
617
|
|
618
618
|
## Revision History
|
619
619
|
|
620
|
-
### Version 2.
|
620
|
+
### Version 2.3.0
|
621
|
+
* Fixnum, Bignum warning messages removed.
|
622
|
+
* Documentation updates
|
623
|
+
|
624
|
+
### Version 2.2.0
|
621
625
|
* Bug fixes for Fraction wrapper
|
622
626
|
* New construction method for Fraction
|
623
627
|
|
data/lib/primitive_wrapper.rb
CHANGED
@@ -459,7 +459,7 @@ class ValueAdd < Value
|
|
459
459
|
end
|
460
460
|
|
461
461
|
class Int < ValueAdd
|
462
|
-
capture_base_methods(
|
462
|
+
capture_base_methods(5.class) # Bignum methods same as Fixnum ... updated ruby no longer uses Fixnum
|
463
463
|
def valid_type(prm)
|
464
464
|
return true if prm.kind_of? Integer
|
465
465
|
return true if prm.kind_of? Int
|
@@ -502,7 +502,7 @@ class FloatW < ValueAdd
|
|
502
502
|
end
|
503
503
|
|
504
504
|
class Number < ValueAdd
|
505
|
-
capture_base_methods(
|
505
|
+
capture_base_methods(5.class)
|
506
506
|
capture_base_methods(Float, self)
|
507
507
|
capture_base_methods(Complex, self)
|
508
508
|
capture_base_methods(Rational, self)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: primitive_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Colvin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blockify
|
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
requirements: []
|
186
186
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.
|
187
|
+
rubygems_version: 2.7.6
|
188
188
|
signing_key:
|
189
189
|
specification_version: 4
|
190
190
|
summary: Thin wrapper for primitive literals
|