Categories: None [Edit]

primitive_wrapper

https://rubygems.org/gems/primitive_wrapper
This gem creates a thin shell to encapsulate primitive literal types such as integers, floats and symbols. There are a family of wrappers which mimic the behavior of what they contain. Primitive types have several drawbacks: no constructor to call, can't create instance variables, and can't create singleton methods. There is some utility in wrapping a primitive type. You can simulate a call by reference for example. You can also simulate mutability, and pointers. Some wrappers are dedicated to holding a single type while others may hold a family of types such as the `Number` wrapper. What is interesting to note is Number objects do not derive from `Numeric`, but instead derive from `Value` (the wrapper base class); but at the same time, `Number` objects mimic the methods of `Fixnum`, `Complex`, `Float`, etc. Many of the wrappers can be used in an expression without having to call an access method. There are also new types: `Bool` which wraps `true,false` and `Property` which wraps `Hash` types. The `Property` object auto-methodizes the key names of the Hash. Also `Fraction` supports mixed fractions.

Total

Ranking: 74,488 of 196,180
Downloads: 13,735

Daily

Ranking: 29,127 of 196,149
Downloads: 5

Depended by

RankDownloadsName
53,11022,147setfu
137,0824,755nth

Depends on

RankDownloadsName
13,673,342,878bundler
81,396,057,225rake
291,011,463,196rspec
108475,369,749byebug
121,4145,993pred
130,3085,161blockify
174,3712,631yieldhelper

Owners

#GravatarHandle
1iconfweekyfweek