Skip to content
Homogeneous Array
Ruby
Find file
Latest commit f7ebd96 @kachick Bump version to 0.0.6
Failed to load latest commit information.
examples Better example
lib Bump version to 0.0.6
test Simplify #to_h
.gitignore pre-declare
.travis.yml Drop Ruby2.0 support
Gemfile pre-declare
MIT-LICENSE Update filetree
README.md Better example
Rakefile Clarify code encodings
family.gemspec Dry in gemspec

README.md

family

Build Status Gem Version Dependency Status

Description

Homogeneous Array

Features

  • The condition is not bound by "types" ... :)

Usage

To use

require 'family'

Simplify

list = Family.new Integer
list << 7      #=> 7
list << 1.0    #=> Exception
list << 1      #=> 1
list.inspect   #=> "Integer ===: [7, 1]

Not bound by "Type"

list = Family.new /\A\S+\z/
list << 'a b c' #=> Exception
list << 'abc'   #=> "abc"
list.inspect    #=> "/\A\S+\z/ ===: ["abc"]"

HighLayer Definition

list = Family.define { AND(Float, 3..6) }
list << 4       #=> Exception
list << 2.0     #=> Exception
list << 4.0     #=> 4.0
list.inspect    #=> a Proc ===: [4.0]

Requirements

Installation

$ gem install family

Link

License

The MIT X11 License
Copyright (c) 2012 Kenichi Kamiya
See MIT-LICENSE for further details.

Something went wrong with that request. Please try again.