ruby tag

542 questions


1 answers
43 views
0
You are about to replace all strings with uppercase and lowercase letters

You are about to replace all of the ruby strings with uppercase and lowercase characters.I used str.upper() in PythonI tried everything with upper, tupper, upperCase, and convertUpper, but it didn't w...

2 years ago

1 answers
118 views
0
I want to know the simplest way to randomly generate a string in Ruby

I'm embarrassed because it's such a simple question.Except for lowercase letters, I want to randomly extract 8 capital letters. For me,value = ; 8.times{value << (65 + rand(25)).chr}#Including l...

2 years ago

1 answers
143 views
0
I want to know how to use random in ruby.

How do I make a number from 0 to n in ruby?

2 years ago

1 answers
103 views
0
Remove the key from the hash on Ruby/Rails and return only the remaining hash

After removing the key from the hash on Ruby/Rails, how can I get only the remaining hash returned?To add a new hash {:a => 1, :b => 2}.merge!({:c => 3}) # => {:a=>1, :b=>2, :c=>3...

2 years ago

1 answers
121 views
0
What are the two colons in Ruby doing?

What does :: do in Foo::Bar?I thought it was related to encapsulation (private, protected), but it's not that when I looked at the definition.The :: is a unary operator that allows: constants, instanc...

2 years ago

1 answers
128 views
0
How do I get input to command line as ruby?

How do I get input to command line as ruby?> cat input.txt | myprog.rb> myprog.rb < input.txt> myprog.rb arg1 arg2 arg3 ...I'm going to get stdin like this, but I'd like to know other ways...


1 answers
156 views
0
Does Ruby have a do-while statement?

I'm creating a program that receives a person's name and stores it in an array until an empty string is entered.When checking for empty strings, you just want to write while statements, so you need to...

2 years ago

1 answers
34 views
0
I want to clear the Ruby Version Manager (RVM). What command should I type?

I'm not used to writing Linux commands yet, so I don't know how to erase them.What is the command to clear the Ruby Version Manager (RVM)?

2 years ago

2 answers
103 views
0
I have a question about heroku.

Error importing template from Cloud9 via heroku...I'm asking this question because it's my first time seeing heroku.The details of the error are as follows. (The language used is Ruby on Rails, Html/c...

2 years ago

1 answers
33 views
0
Method to determine if a variable already exists or not

Which method should we use to find out if a variable already exists or not in Ruby?For example, a = 3isset? a #trueisset? v #falseI'm looking for a method that returns true only when it's a variable t...

2 years ago
« - 47 - »

© 2024 OneMinuteCode. All rights reserved.