0.0
No release in over 3 years
Expressions evaluate into useful objects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 1.0
 Project Readme

Gem version

Expressions logo

Expressions

Expressions evaluate into useful objects via a query builder like interface.

Installation

Add gem 'expressions' to your Gemfile then:

bundle install

API

type()

my_var = type MyType | fetch_my_object(id: 123)

my_var is now type checked to be of type MyType when assigned to.

For more information on type expressions see LowType gem.

value()

For more information on value expressions see LowType gem.

config()

Coming soon...

ref()

Coming soon...

table() [UNRELEASED]

The table expression inverts the usual database query logic. Instead of building a query of what we want from the database, we build the table we want and let the expression build the query.

table(:username > :title | :body)

The above expression builds a ORM query to right join the user table into the articles table and results in a list of articles with the user's username in each row