<commit_before># HelloBlock

Fluent ruby wrapper for the [HelloBlock](http://www.helloblock.io) API.  For a simple, non-fluent wrapper, see [helloblock-ruby](http://github.com/nathanielwroblewski/helloblock-ruby).

## Installation

Add this line to your application's Gemfile:

    gem 'helloblock'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install helloblock

## Usage

Configure your HelloBlock session:

```rb
HelloBlock.configure do |config|
  config.api_key = 'APIKEY' # your api key goes here
  config.version = :v1      # defaults to latest version
  config.network = :mainnet # defaults to testnet
end
```

Query the HelloBlock API with familiar [ActiveRecord](https://github.com/rails/rails/tree/master/activerecord)-like syntax.  NOTE: As of the current version, `#to_hash` must be called on each completed query as a kicker method.

Description  | Method
------------- | ------------- |
Fetch a single address  | `HelloBlock::Address.find('1DQN9nop...').to_hash`|
Fetch batch addresses  | `HelloBlock::Address.where(address: ['1DQN9nop...', ...]).to_hash` |
Fetch unspents for address  | `HelloBlock::Address.find('1DQN9nop...').unspents.to_hash` |
Fetch unspents for addresses  | `HelloBlock::Address.where(address: ['1DQN9nop...', ...]).unspents.to_hash` |
Fetch a single transaction  | `HelloBlock::Transaction.find('f37e6181...').to_hash` |
Fetch batch transactions  | `HelloBlock::Transaction.where(transaction: ['f37e6181...', ...]).to_hash` |
Fetch transactions by addresses  | `HelloBlock::Transaction.where(address: ['1DQN9nop...', ...]).to_hash` |
Fetch latest transactions  | `HelloBlock::Transaction.last(5).offset(7).to_hash` |

## 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>Update readme for more idiomatic unspents placement in query<commit_after># HelloBlock

Fluent ruby wrapper for the [HelloBlock](http://www.helloblock.io) API.  For a simple, non-fluent wrapper, see [helloblock-ruby](http://github.com/nathanielwroblewski/helloblock-ruby).

## Installation

Add this line to your application's Gemfile:

    gem 'helloblock'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install helloblock

## Usage

Configure your HelloBlock session:

```rb
HelloBlock.configure do |config|
  config.api_key = 'APIKEY' # your api key goes here
  config.version = :v1      # defaults to latest version
  config.network = :mainnet # defaults to testnet
end
```

Query the HelloBlock API with familiar [ActiveRecord](https://github.com/rails/rails/tree/master/activerecord)-like syntax.  NOTE: As of the current version, `#to_hash` must be called on each completed query as a kicker method.

Description  | Method
------------- | ------------- |
Fetch a single address  | `HelloBlock::Address.find('1DQN9nop...').to_hash`|
Fetch batch addresses  | `HelloBlock::Address.where(address: ['1DQN9nop...', ...]).to_hash` |
Fetch unspents for address  | `HelloBlock::Address.find('1DQN9nop...').unspents.to_hash` |
Fetch unspents for addresses  | `HelloBlock::Address.unspents.where(address: ['1DQN9nop...', ...]).to_hash` |
Fetch a single transaction  | `HelloBlock::Transaction.find('f37e6181...').to_hash` |
Fetch batch transactions  | `HelloBlock::Transaction.where(transaction: ['f37e6181...', ...]).to_hash` |
Fetch transactions by addresses  | `HelloBlock::Transaction.where(address: ['1DQN9nop...', ...]).to_hash` |
Fetch latest transactions  | `HelloBlock::Transaction.last(5).offset(7).to_hash` |

## 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.1482996676041933, 'fraction_numerical': 0.015341344924571721, 'mean_word_length': 4.16776750330251, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '5334754', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1194, 'n_words': 359}