-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Adds ability to retrieve a company's logo #10
Conversation
rodolfobandeira
commented
Jul 26, 2018
6fa9b74
to
85a2f52
Compare
Add a line to https://github.com/dblock/iex-ruby-client/blob/master/CHANGELOG.md and this is good to go! Thanks. |
@dblock Added. Thanks! |
spec/iex/resources/logo_spec.rb
Outdated
end | ||
|
||
it 'retrieves a logo' do | ||
expect(subject['url']).to eq 'https://storage.googleapis.com/iex/api/logos/MSFT.png' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed that it's returning a structure. This should actually return a 1st class object called Logo
with a property called url
. See how it's done for OHLC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I didn't notice that. So, now it should be good:
9: it 'retrieves a logo' do
10: require 'byebug'
11: byebug
=> 12: expect(subject.url).to eq 'https://storage.googleapis.com/iex/api/logos/MSFT.png'
13: end
14: end
15: end
(byebug) subject
#<IEX::Resources::Logo url="https://storage.googleapis.com/iex/api/logos/MSFT.png">
(byebug) subject.url
"https://storage.googleapis.com/iex/api/logos/MSFT.png"
(byebug)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, minor suggestions if you want to do them.
Needs to be rebased and green and ready to merge.
README.md
Outdated
logo.url # 'https://storage.googleapis.com/iex/api/logos/MSFT.png' | ||
``` | ||
|
||
See [#logo](https://iextrading.com/developer/docs/#logo) for detailed documentation or [logo.rb](lib/iex/resources/logo.rb) for returned field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"returned fields" (plural), even though single field right now probably.
spec/iex/resources/logo_spec.rb
Outdated
require 'spec_helper' | ||
|
||
describe IEX::Resources::Logo do | ||
context "retrieve company's logo", vcr: { cassette_name: 'logo/msft' } do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor, "retrieves company's logo", just more idiomatic
567d1bd
to
0c282a0
Compare
@dblock Fixed typos and rebase the latest master. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor issue in CHANGELOG I missed, then it's ready to merge.
Also a good practice for these pull requests is to squash them, so you end up with one single commit to avoid a squash on merge. Give it a try.
CHANGELOG.md
Outdated
@@ -7,6 +7,7 @@ | |||
* [#5](https://github.com/dblock/iex-ruby-client/pull/5): Added `IEX::Resources::OHLC#get` - [@jromanovs](https://github.com/jromanovs). | |||
* [#5](https://github.com/dblock/iex-ruby-client/pull/5): Added `IEX::Resources::OHLC#market` - [@jromanovs](https://github.com/jromanovs). | |||
* [#9](https://github.com/dblock/iex-ruby-client/pull/9): Added `IEX::Errors::ClientError` - [@rodolfobandeira](https://github.com/rodolfobandeira). | |||
* [#10](https://github.com/dblock/iex-ruby-client/pull/10): Added `IEX::Resources::Logo#get` - [@rodolfobandeira](https://github.com/rodolfobandeira). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this, this changelog entry and the one above belongs in 0.3.4 above, not in the released 0.3.3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Please let me know if that is in the correct format. I guess you'll add the new entry 0.3.5
and edit the date when you release the 0.3.4
right?
Thanks again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right.
0c282a0
to
27f807f
Compare
Merged, thanks! |