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:
=

installieren:
=

Versionen:

  1. 0.1.0 May 03, 2020 (10,5 KB)

Development Abhängigkeiten (1):

rspec ~> 3.2

Besitzer:

Pushed by:

Autoren:

  • Alexis Kalderimis

SHA 256-Prüfsumme:

=

Downloads insgesamt 2.041

Für diese Version 2.041

Version veröffentlicht:

Lizenz:

MIT

Erforderliche Ruby-Version: >= 2.7.0

Links: