A Ruby client for Warframe Stat bringing you live modeled data from their API.
Add this line to your application's Gemfile:
gem 'warframe'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install warframe
To get started accessing live data, you must instantiate a new Warframe::REST::Client
require 'warframe'
client = Warframe::REST::Client.new # => <Warframe::REST::Client platform='pc' language='en'>
# You can supply a hash to set your preferred platform or language.
my_custom_options = { platform: 'ps4', language: 'de' }
german_ps4 = Warframe::REST:Client.new my_custom_options # => <Warframe::REST::Client platform='ps4' language='de'>
This gives us access to a plethora of methods, check out the documentation for more info.
client = Warframe::REST::Client.new
client.nightwave # => <Warframe::Models::Nightwave>
client.alerts # => [ <Warframe::Models::Alert>, <Warframe::Models::Alert> ]
Documentation is currently provided by rubydoc.info, check out the current versions documentation at https://rubydoc.info/gems/warframe.
After checking out the repo, run:
$ bundle install
This will install all required dependencies for this gem to run.
To check if your changes are passing tests, run:
$ thor test:rspec
Testing framework provided by RSpec.
To auto-correct styling offenses, run:
$ thor style:fix
All linting is provided by RuboCop.
Using Thor allows us to create new routes and models via the command line, making it very simple to add new elements.
For example if we wanted to add, conclaveChallenges we run:
$ thor generate conclaveChallenges
> create lib/warframe/models/conclave_challenge.rb
> create lib/warframe/rest/api/conclave_challenges.rb
> conflict lib/warframe/rest/api.rb
> Overwrite ~/warframe/lib/warframe/rest/api.rb? (enter "h" for help) [Ynaqdh]
$ Y
> force lib/warframe/rest/api.rb
This creates a blank model for the data and a route with a name spaced method for it, and then adds this method to our REST::API. Add attributes to the corresponding model and then write associated tests.
Bug reports and pull requests are welcome on GitHub at https://github.com/aj-rom/warframe-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.