ruby tag

542 questions


1 answers
34 views
0
What are the differences between Ruby's Double Splat and Ruby's other features?

Drat!-Ruby has a Double Splat-Firmafon Developers Blog I saw .deff(**options) options#=>{:hoge=>AAA,:foo=>BBB}endfoge: AAA, foo: BBBand deff(options={}) options#=>{:hoge=>AAA,:foo=>B...

2 years ago

2 answers
31 views
0
I want Ruby to write the contents of the variable to a file.

How can Ruby temporarily write the contents of a variable to a file?We handle hash or array, and we used to write it in JSON and parse it when we needed it, but as the capacity increases, it takes a l...

2 years ago

5 answers
39 views
0
I want to look up the description of the Ruby-File.read() method in the API document.

I'm learning how Ruby works from the beginning.http://docs.ruby-lang.org/ja/2.1.0/class/File.htmlWhat should I do to find out the read method?There are singular methods, but where are the non-specific...

2 years ago

2 answers
130 views
0
I want to use columns (numerical) that continue to change in rails for validation.

In rails, we have created a function to use (pay) points (quantities).I would like to validate the amount of payment.Specifically, if the payment amount is below the account balance of the payment use...


2 answers
42 views
0
About hash notation (there are two ways to get values for keys: hoge[:title] and hoge.title)

When I deal with values from json, I always get confused because I don't know which of the following two patterns.hoge [:title]hoge.title< Assume that the value of the key is obtainedHandling hash whe...

2 years ago

2 answers
36 views
0
I don't know how to fix the undefined method error.

Ruby is a beginnerhttp://ascii.jp/elem/000/001/255/1255878/ by referring to the site.I have created the following code.- Uh-huh-huh-huh-huh-huh-huh-huh-huh-huh-huhrequire minrubydefault(tree)  case tr...

2 years ago

1 answers
89 views
0
Regarding ruby on rails, regarding the search for activerecord using ransack.

What do you want to solveWe are implementing a soccer player search function using ransack.Search by keyword is successful, but activecord cannot be searchedThe form data is going well, but I don't kn...


2 answers
36 views
0
If Ruby has zero decimal places, is there a good way to delete it?

I would like the following values.10.0 → 101.5 → 1.5 In the following process, the value=1 instead of value=1.0, but Is there a better way? value = 10.0/10 (some calculation)if value==value.to_i value...

2 years ago

5 answers
41 views
0
Do you have a JavaScript library that provides Ruby-like APIs?

I'm usually used to Ruby, so when I use JavaScript to manipulate arrays, hashes, strings, etc., it's troublesome to look for or implement Ruby's method in JavaScript.So please let me know if there is ...

2 years ago

1 answers
28 views
0
become the same before and after the sequence is converted

a=[1,2],[]]b = Array.new(a)b[1].push(b[0].pop)I want to change a to before and after b to Both become [[1], [2]]My mistake? Ruby's mistake?

2 years ago
« - 25 - »

© 2024 OneMinuteCode. All rights reserved.