<commit_before># Heredity

Heredity adds on_inherit hooks to Ruby which providing a clean way execute code on inherited classes without the need to override `inherited`. It also adds the ability to specify class instance variables that should be copied to subclasses.

## Installation

Add this line to your application's Gemfile:

    gem 'heredity'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install heredity

## Usage

#### On inherit

To use Heredity's inheritance hooks, simply call `on_herit` with a block:

```Ruby
class Foo
  on_inherit do
    puts 'Child of Foo!'
  end
end

This is very useful for injecting behavior into subclasses that is dependent on class state (e.g. behavior that relies on the columns of an active record model).<commit_msg>Fix syntax error in Readme.<commit_after># Heredity

Heredity adds on_inherit hooks to Ruby which providing a clean way execute code on inherited classes without the need to override `inherited`. It also adds the ability to specify class instance variables that should be copied to subclasses.

## Installation

Add this line to your application's Gemfile:

    gem 'heredity'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install heredity

## Usage

#### Inheritance hooks

To use Heredity's inheritance hooks, simply call `on_herit` with a block:

```Ruby
class Foo
  on_inherit do
    puts 'Child of Foo!'
  end
end
```

This is very useful for injecting behavior into subclasses that is dependent on class state (e.g. behavior that relies on the columns of an active record model).
{'fraction_non_alphanumeric': 0.052598622417031934, 'fraction_numerical': 0.0, 'mean_word_length': 4.009404388714733, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2573120', 'n_tokens_mistral': 450, 'n_tokens_neox': 417, 'n_words': 231}