Skip to content

Commit

Permalink
Add a history endpoint
Browse files Browse the repository at this point in the history
- A very basic history endpoint as described in the issue rodolfobandeira#39
- Doesn't yet support all the filters that are described in the documentation provided here https://documenter.getpostman.com/view/2025350/RWaEzAiG#9f1dfdc0-fbe8-4ae5-9209-7f3d649a627c
- Allows retrieving all the historical events or a specific historical event by passing an id
- This closes rodolfobandeira#39 when merged in.

Notes:
- Also decided to alphabetize the order in which we `require` the files in the `spacex.rb` file
  • Loading branch information
invacuo committed Oct 16, 2018
1 parent d82752a commit 4d331b4
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
### 1.0.1 (next)
* [#45](https://github.com/rodolfobandeira/spacex/pull/45): Implement History endpoint [@invacuo](http://github.com/invacuo).

* Your contribution here.

### 1.0.0 (2018/10/15)

* [#41](https://github.com/rodolfobandeira/spacex/pull/41): General Refactor cleaning endpoint classes [@invacuo](http://github.com/invacuo).
* [#44](https://github.com/rodolfobandeira/spacex/pull/44): Add flickr_images key into rockets endpoint [@Dfenniak](https://github.com/Dfenniak).
* [#42](https://github.com/rodolfobandeira/spacex/pull/42): Add pry gem to debug - [@Dfenniak](https://github.com/Dfenniak).
Expand Down
13 changes: 7 additions & 6 deletions lib/spacex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
require 'hashie'

require_relative 'spacex/base_request'
require_relative 'spacex/version'
require_relative 'spacex/launches'
require_relative 'spacex/capsules'
require_relative 'spacex/company_info'
require_relative 'spacex/roadster'
require_relative 'spacex/cores'
require_relative 'spacex/dragon_capsules'
require_relative 'spacex/ships'
require_relative 'spacex/history'
require_relative 'spacex/launches'
require_relative 'spacex/missions'
require_relative 'spacex/roadster'
require_relative 'spacex/rockets'
require_relative 'spacex/capsules'
require_relative 'spacex/cores'
require_relative 'spacex/ships'
require_relative 'spacex/version'
7 changes: 7 additions & 0 deletions lib/spacex/history.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module SPACEX
module History
def self.info(id = nil)
SPACEX::BaseRequest.info("history/#{id}")
end
end
end
62 changes: 62 additions & 0 deletions spec/fixtures/spacex/history/info.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions spec/fixtures/spacex/history/info/4.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4d331b4

Please sign in to comment.