61 lines
2.1 KiB
Markdown
61 lines
2.1 KiB
Markdown
StrikeMe::API
|
|
==============
|
|
|
|
This is a ruby gem to interact with the strike.me API. It is an inition proof of concept implementation.
|
|
As a reference, the documentation of the [Strike API](https://docs.strike.me/api)
|
|
|
|
Installation
|
|
-------------
|
|
|
|
TODO: Replace `strike_me-api` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
|
|
|
Install the gem and add to the application's Gemfile by executing:
|
|
|
|
```bash
|
|
bundle add strike_me-api
|
|
```
|
|
|
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
|
|
|
```bash
|
|
gem install strike_me-api
|
|
```
|
|
|
|
Playground
|
|
-----------------
|
|
To play around with this api you can start a REPL using one of the following commands from the project's root:
|
|
```bash
|
|
pry -r strike_me/api
|
|
# or
|
|
irb -I lib -r strike_me/api
|
|
```
|
|
Then type code like:
|
|
```ruby
|
|
account = StrikeMe::API::Account.new
|
|
account.profile.attributes
|
|
account.balances.map(&:attributes) # same as account.balances.to_a
|
|
account.balances.btc # to get the BTC specific one
|
|
|
|
invoices = StrikeMe::API::Invoices.new
|
|
invoices.any?
|
|
```
|
|
|
|
Usage
|
|
--------------
|
|
|
|
TODO: Write usage instructions here, for now, look at Playground
|
|
|
|
## Development
|
|
|
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
|
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
|
|
## Contributing
|
|
|
|
Bug reports and pull requests are welcome on GitHub at https://gitlab.com/benja-2/strike_me-api.
|
|
|
|
## License
|
|
|
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|