<commit_before># sequel-bit-fields

This is a plugin for [Sequel](http://sequel.rubyforge.org/) which allows the creation of bitfields.
With bitfields you can define flags / booleans / bits /whatsoever for you model.

## Usage

Let's define a model:

```ruby
require 'sequel-bit-fields'

class MyModel < Sequel::Model
  # generic:
  plugin :bit_fields, :the_respective_column, [ :the, :different, :flags, :or, :bits ]

  # real world:
  plugin :bit_fields, :status_bits, [ :started, :finished, :reviewed ]
end
```

And now we can play around with an instance of it:

```ruby
model = MyModel.create

model.started?       // => false
model.started = true
model.started?       // => true
model.status_bits    // => 1

model.finished?      // => false
model.finished = true
model.finished?      // => true
model.status_bits    // => 3<commit_msg>build status<commit_after># sequel-bit-fields

This is a plugin for [Sequel](http://sequel.rubyforge.org/) which allows the creation of bitfields.
With bitfields you can define flags / booleans / bits /whatsoever for you model.

[![Build Status](https://secure.travis-ci.org/sdepold/sequel-bit_fields.png)](http://travis-ci.org/sdepold/sequel-bit_fields)

## Usage

Let's define a model:

```ruby
require 'sequel-bit-fields'

class MyModel < Sequel::Model
  # generic:
  plugin :bit_fields, :the_respective_column, [ :the, :different, :flags, :or, :bits ]

  # real world:
  plugin :bit_fields, :status_bits, [ :started, :finished, :reviewed ]
end
```

And now we can play around with an instance of it:

```ruby
model = MyModel.create

model.started?       // => false
model.started = true
model.started?       // => true
model.status_bits    // => 1

model.finished?      // => false
model.finished = true
model.finished?      // => true
model.status_bits    // => 3
{'fraction_non_alphanumeric': 0.13867403314917126, 'fraction_numerical': 0.0022099447513812156, 'mean_word_length': 3.4937965260545907, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '30306', 'n_tokens_mistral': 624, 'n_tokens_neox': 584, 'n_words': 172}