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

Remove default range and use iextrading default range 1m instead in IEX::Api::Dividends #39

Merged
merged 4 commits into from
Nov 23, 2018

Conversation

ildarkayumov
Copy link

It looks like there is a typo when using range option.

for example

  IEX::Resources::Dividends.get('AAPL', '5y')

generates

  "AAPL/dividends/6m/5y"

instead of

  "AAPL/dividends/5y"

as described in docs - https://iextrading.com/developer/docs/#dividends

CHANGELOG.md Outdated
@@ -1,5 +1,6 @@
### 0.4.4 (next)

* [#39](https://github.com/dblock/iex-ruby-client/pull/39): Fix typo: remove useless range - [@ildarkayumov](https://github.com/ildarkayumov)
Copy link
Owner

@dblock dblock Nov 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually you've fixed a bug, not a typo, so this should describe what was fixed.

Copy link
Author

@ildarkayumov ildarkayumov Nov 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to change commit and changelog?

thank you

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, my initial comment was wrong. Just describe the actual fix. Maybe README also needs to say that the default range is '6m'?

Copy link
Author

@ildarkayumov ildarkayumov Nov 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, better not to overwrite default range because iex api use 1m as default

https://api.iextrading.com/1.0/stock/aapl/dividends

So we can simply use range

IEX::Api.default_connection [
  symbol,
  'dividends',
  range
].compact.join('/')

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that makes a lot of sense, I prefer that. Make the changes! Thanks.

@dblock
Copy link
Owner

dblock commented Nov 8, 2018

Nice catch, this is a bug. Get this to 💚 and thank you!

@ildarkayumov ildarkayumov force-pushed the fix-dividends-api-typo branch 2 times, most recently from 8de0dc7 to d02ce0f Compare November 8, 2018 16:47
@@ -9,8 +9,7 @@ def self.connection(symbol, range = nil)
IEX::Api.default_connection [
symbol,
'dividends',
range ? '6m' : nil,
range
range ? range : '6m'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be range || '6m'

CHANGELOG.md Outdated
@@ -1,5 +1,6 @@
### 0.4.4 (next)

* [#39](https://github.com/dblock/iex-ruby-client/pull/39): Fix: remove useless range in dividends api - [@ildarkayumov](https://github.com/ildarkayumov).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually fixes the default range, doesn't it?

Copy link
Author

@ildarkayumov ildarkayumov Nov 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fixes default range and removes duplicated range use.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets say that

@ildarkayumov ildarkayumov force-pushed the fix-dividends-api-typo branch from d02ce0f to cad4b00 Compare November 15, 2018 07:37
@ildarkayumov ildarkayumov changed the title Fix typo: remove useless range Remove default range and use iextrading default range 1m instead in IEX::Api::Dividends Nov 20, 2018
@dblock dblock merged commit 56d0d19 into dblock:master Nov 23, 2018
@dblock
Copy link
Owner

dblock commented Nov 23, 2018

Sorry for the delay, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants