<commit_before># Fetchable

TODO: Write a gem description

## Installation

Add this line to your application's Gemfile:

    gem 'fetchable'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install fetchable

## Usage

TODO: Write usage instructions here

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
<commit_msg>Flesh out description for some README driven dev<commit_after># Fetchable

Provides a decorator to add a `Hash#fetch` like interface to any object.

You must specify a method which it should delegate to and pass the key.

`Hash#Fetch` is one of my favourite Ruby methods and can be tricky to implement
its full behaviour so here it is extracted for you to add to whichever object
you choose.

## Installation

Add this line to your application's Gemfile:

    gem 'fetchable'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install fetchable

## Usage

```ruby
require "fetchable"

array = ["zero", "one", "two"]

fetchable_array = Fetchable.new(array, :finder_method => :[])

fetchable_array.fetch(0)
 => "zero"

fetchable_array.fetch(2)
 => "two"

fetchable_array.fetch(3)
 => KeyError key not found 3

fetchable_array.fetch(3, "three")
 => "three"

fetchable_array.fetch(3) { "Execute a block!" }
 => "Execute a block!"

fetchable_array.fetch(3) { |key| "Do something based on missing key #{key}" }
 => "Do something based on missing key 3"
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

{'fraction_non_alphanumeric': 0.10048886474741989, 'fraction_numerical': 0.00977729494839761, 'mean_word_length': 4.032786885245901, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '1233658', 'n_tokens_mistral': 587, 'n_tokens_neox': 560, 'n_words': 244}