RubyGems Navigation menu

deconstructable 0.1.0

This gem provides Deconstructable, a mixin module that helps you to support pattern-matching over your types. Usage -------- ``` class Thing include Deconstructable ... deconstructable :x, :y deconstructable def foo do_the_foo end end ``` This class provides a single DSL method `deconstructable` which helps you to mark methods and attributes as deconstructable. Deconstructable attributes will be made available in pattern matching, e.g.: ``` thing in Thing(foo:, x: 100, y:) ``` Classes that include `Deconstructable` gain an implementation of `deconstruct_keys` that permits hash-style key based pattern matching. Positional array-style patterns are not supported.

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

インストール:
=

バージョン履歴:

  1. 0.1.0 - May 03, 2020 (10.5KB)

Development依存関係 (1):

rspec ~> 3.2

所有者:

プッシュ者:

作者:

  • Alexis Kalderimis

SHA 256チェックサム:

a9e5d1516f32c8dc21a5baab5d4a38d072a94cc7dff8218db587635855d523fb

累計ダウンロード数 1,933

このバージョンのみ 1,933

ライセンス:

MIT

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

リンク: