sdk-ruby icon indicating copy to clipboard operation
sdk-ruby copied to clipboard

ruby conventions

Open SampsonCrowley opened this issue 7 years ago • 4 comments

Your ruby code blantantly ignores most ruby conventions (e.g. underscore_method_names) and uses (what looks like) java based naming schemes everywhere

Is an expectation to migrate this sdk to use ruby conventions ever going to be reasonable for a major release? I wouldn't mind helping, if that isn't something you would be opposed to

SampsonCrowley avatar Oct 05 '18 20:10 SampsonCrowley

also related to #143

SampsonCrowley avatar Oct 05 '18 20:10 SampsonCrowley

Hi,

Thank you for your suggestions and offer.

This message has been communicated to the team and we will try to adhere to the conventions of the language as much as possible.

We will keep you in mind, should any help be required.

gnongsie avatar Oct 23 '18 05:10 gnongsie

I believe this also is breaking rails 6 with zeitwerk

Hold on, I am eager loading the application.

WARNING: The files in these directories cannot be checked because they
are not eager loaded:

  /Users/taf2/.rvm/gems/ruby-2.6.5@ctm3/gems/authorizenet-2.0.0/lib/app/helpers

You may verify them manually, or add them to config.eager_load_paths
in config/application.rb and run zeitwerk:check again.

Otherwise, all is good!

taf2 avatar Jan 13 '20 18:01 taf2

I have to second this, the entire SDK was written in Ruby as if its Java also related to 143
eg you should pass in the attributes as parameters on object creation, in addition, use key-value pairs for the parameters so the order is not important

request.sorting = TransactionListSorting.new;
 request.sorting.orderBy = TransactionListOrderFieldEnum::Id;
  request.sorting.orderDescending = true;    
    vs   request.sorting =TransactionListSorting.new(orderBy:TransactionListOrderFieldEnum::Id, orderDescending:true);

gbs4ever avatar Apr 11 '24 16:04 gbs4ever