|
1 |
| -# Natero |
| 1 | +[api-docs]: https://apidocs.natero.com/ |
| 2 | +[free-sw]: https://www.fsf.org/licensing/essays/free-sw.html |
| 3 | +[issues]: https://github.com/bonusly/natero/issues |
| 4 | +[fork]: http://help.github.com/fork-a-repo/ |
| 5 | +[branch]: http://learn.github.com/p/branching.html |
| 6 | +[pr]: http://help.github.com/send-pull-requests/ |
2 | 7 |
|
3 |
| -Wrapper for Natero API |
| 8 | +# Natero Gem |
| 9 | +A Ruby interface for the [Natero Public API][api-docs]. |
| 10 | + |
| 11 | +## Installation |
| 12 | +```Bash |
| 13 | +gem install natero |
| 14 | +``` |
| 15 | + |
| 16 | +## Examples |
| 17 | +Significant functionality is covered with this gem, but some basic functionality is covered below. |
| 18 | +If you're interested in learning more, it's probably easiest to explore the specs in `/spec/natero`. |
| 19 | + |
| 20 | +Set up your keys: |
| 21 | +```Ruby |
| 22 | +Natero.configure do |c| |
| 23 | + c.account_api_key = 'ACCOUNT_API_KEY' |
| 24 | + c.event_api_key = 'EVENT_API_KEY' |
| 25 | + c.event_auth_key = 'EVENT_AUTH_KEY' |
| 26 | +end |
| 27 | +``` |
| 28 | + |
| 29 | +Retrieve all accounts: |
| 30 | +```Ruby |
| 31 | +Natero::Account.retrieve_all |
| 32 | +``` |
| 33 | + |
| 34 | +Retrieve a specific account: |
| 35 | +```Ruby |
| 36 | +Natero::Account.retrieve('ACCOUNT_ID') |
| 37 | +``` |
| 38 | + |
| 39 | +Modify an account: |
| 40 | +```Ruby |
| 41 | +account = Natero::Account.retrieve('ACCOUNT_ID') |
| 42 | +account.name = 'TEST' |
| 43 | + |
| 44 | +Natero::Account.modify('ACCOUNT_ID', account) |
| 45 | +``` |
| 46 | + |
| 47 | +Create an event: |
| 48 | +```Ruby |
| 49 | +event = { id: 'test', name: 'Testing the API.'} |
| 50 | +details = 'These details should be associated with the event in Natero' |
| 51 | + |
| 52 | +Natero::Event.create(event, details) |
| 53 | +``` |
| 54 | + |
| 55 | +## Contributing |
| 56 | +In the spirit of [free software][free-sw], **everyone** is encouraged to help |
| 57 | +improve this project. Here are some ways *you* can contribute: |
| 58 | + |
| 59 | +* Report bugs. |
| 60 | +* Suggest new features. |
| 61 | +* Write or edit documentation. |
| 62 | +* Write specifications. |
| 63 | +* Write code (**no patch is too small**: fix typos, add comments, clean up inconsistent whitespace). |
| 64 | +* Refactor code. |
| 65 | +* Fix [issues][]. |
| 66 | + |
| 67 | +#### Submitting an issue: |
| 68 | +We use the [GitHub issue tracker][issues] to track bugs and features. Before |
| 69 | +submitting a bug report or feature request, check to make sure it hasn't |
| 70 | +already been submitted. When submitting a bug report, please include a stack |
| 71 | +trace and any details that may be necessary to reproduce |
| 72 | +the bug, including your gem version, Ruby version, and operating system. |
| 73 | +Ideally, a bug report should include a pull request with failing specs. |
| 74 | + |
| 75 | +#### Submitting a Pull Request |
| 76 | +1. [Fork the repository.][fork] |
| 77 | +2. [Create a topic branch.][branch] |
| 78 | +3. Add specs for your unimplemented feature or bug fix. |
| 79 | +4. Run `bundle exec rake spec`. If your specs pass, return to step 3. |
| 80 | +5. Implement your feature or bug fix. |
| 81 | +6. Run `bundle exec rake spec`. If your specs fail, return to step 5. |
| 82 | +7. Add documentation for your feature or bug fix. |
| 83 | +8. Commit and push your changes. |
| 84 | +9. [Submit a pull request.][pr] |
| 85 | + |
| 86 | +_(Shamelessly based on the [Twitter Gem](https://github.com/sferik/twitter))_ |
0 commit comments