RubyGems Navigation menu

primitive_wrapper 2.3.0

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.

Gemfile:
= クリップボードにコピー コピー完了!

インストール:
=

バージョン履歴:

  1. 2.3.0 - March 26, 2018 (25.5KB)
  2. 2.2.0 - February 12, 2018 (25.5KB)
  3. 2.1.0 - February 03, 2018 (25.5KB)
  4. 2.0.0 - January 22, 2018 (24KB)
  5. 1.0.1 - January 12, 2018 (23.5KB)
全てのバージョンを表示(全7件)

Runtime依存関係 (3):

blockify >= 0.2.0, ~> 0.2
pred >= 0.1.2, ~> 0.1
yieldhelper >= 0.1.0, ~> 0.1

Development依存関係 (4):

bundler ~> 1.11
byebug >= 5.0.0, ~> 5.0
rake ~> 10.0
rspec ~> 3.0

所有者:

作者:

  • Bryan Colvin

SHA 256チェックサム:

= クリップボードにコピー コピー完了!

累計ダウンロード数 11,682

このバージョンのみ 2,159

ライセンス:

MIT

必要なRubyのバージョン: >= 2.2.0

リンク: