Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gem name in README #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,35 @@

## Installation

- Add `gem "clabe"` to your application's Gemfile and then execute `bundle`.
- Or install it yourself as: `gem install clabe`
Add to your application’s Gemfile:

```rb
gem "clabe_mx", require: "clabe"
```

And execute `bundle`.

## Usage

#### Validate and serialize
#### Validate

Successful validation:

Successfully validation
```ruby
CLABE = '002114016003269412'
Clabe.validate(CLABE)
# returns { is_valid: true, bank_tag: 'BANAMEX', city: 'Huixtla' }
validation = Clabe.validate("002114016003269412")
validation.is_valid? # => true
validation.bank_tag # => "BANAMEX"
validation.bank_name # => "Banco Nacional de México, S.A."
validation.bank_code # => "002"
validation.city # => "Huixtla"
```

Invalid validation
Invalid validation:

```ruby
CLABE = '002010077777777779'
Clabe.validate(CLABE)
# returns { is_valid: false, error: 'Must have a valid control digit' }
validation = Clabe.validate("002010077777777779")
validation.is_valid? # => false
validation.errors # => ["must have a valid control digit"]
```

## License
Expand Down