Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 10837

Ruby is a multi-platform, open-source, dynamic, object-oriented, interpreted language created by Yukihiro Matsumoto (Matz) in 1993.

4 votes
2 answers
242 views

Multiple attempts to find the best icon

I have a series if statements where I am trying to find the highest resolution file in an set of files. Is there a way that I can refactor this code to be shorter and or cleaner? begin icon = icons …
Antarr Byrd's user avatar
15 votes
4 answers
14k views

Setting the default display name for my model

I have a method in my Ruby code that sets the default name for my model. Rubocop complains that Assignment Branch Condition Size is too high, 21.24/15. How can I improve this? …
Antarr Byrd's user avatar
3 votes
1 answer
79 views

Initializing a new user

I have a method in my rails project that initializes a new user by copying some properties of another. The method should also retain entered parameters if saving the new user is rejected. Rubocop comp …
Antarr Byrd's user avatar
4 votes
2 answers
284 views

Decorator pattern for an application

I've created a decorator in my Rails application. However, the initializer has 3 params. Is this generally acceptable in decorator or should I refactor this or try a different pattern? class FileBind …
Antarr Byrd's user avatar
3 votes
2 answers
70 views

Purchase controller search method

I've been trying to simplify a search method in a project that I've taken over. Is it possible to make the code any cleaner than I already have done? purchase_controller#search (original) def searc …
Antarr Byrd's user avatar
4 votes
1 answer
2k views

Error handling for Stripe credit card processing

I have a rails application that uses Stripe for credit card processing. Currently several exceptions are being handled anywhere a transaction takes place. The code below is being used currently in 11 …
Antarr Byrd's user avatar
4 votes
2 answers
2k views

Performance of Codility MaxCounter challenge solution

I'm doing some of the Codility challenges using Ruby. …
Antarr Byrd's user avatar
2 votes
2 answers
179 views

"Reverse Groups" challenge

I'm trying to do the Reverse Groups Challenge on CodeEval: Given a list of numbers and a positive integer k, reverse the elements of the list, k items at a time. If the number of elements is not a …
Antarr Byrd's user avatar
2 votes
2 answers
295 views

Rails controller method to create a customer with credit card info

I'm working on a Rails application that has a lot of logic in the controller that should be in the model. In the app/controllers/customers_controller.rb#create there is logic to create stripe cc info …
Antarr Byrd's user avatar