mollie / mollie-api-ruby

Mollie API client for Ruby
http://www.mollie.com
BSD 2-Clause "Simplified" License
81 stars 42 forks source link

Make the gem more Ruby-like #3

Closed jurriaan closed 9 years ago

jurriaan commented 10 years ago

Please adhere to some sort of Ruby style guide (for example https://github.com/bbatsov/ruby-style-guide).

Things like 2 space soft-indent and under_scored_method_names are pretty common in the Ruby community.

It would also be great if you had a setter on the class for the API Key, something like this:

Mollie::API::Client.api_key = 'key_here'

That would make the usage of this gem much more pleasant in for example Rails.

RickWong commented 10 years ago

Thanks for the tips! We will look into this as soon as we have time. We do accept style-related PRs as well, so feel free to work with us to create a more Ruby-programmer friendly gem! (We can add your name to the contributions.)

I'll be putting this issue on our to-do list.

dennisdevulder commented 9 years ago

mollie = Mollie::API::Client.new(api_key: 'key_here') would be great

RickWong commented 9 years ago

Hi Dennis. We don't want to make the API client incompatible with dependency injection principles that some of our users follow. That's why configuration of the API key happens outside of the constructor.

rogierslag commented 9 years ago

this issue could be closed based on https://github.com/mollie/mollie-api-ruby/pull/9 right?

dennisdevulder commented 9 years ago

Great improvement rogierslag, thanks!

rogierslag commented 9 years ago

I have to say that wasnt me though ;)

willemstuursma commented 9 years ago

Changes have been made in #9.