LoginSignup
1
0

More than 3 years have passed since last update.

Ruby勉強日誌2

Last updated at Posted at 2019-11-11

自分の復習用に基礎的な文言をまとめてみました。

配列:一つの変数に複数の値を入れること

hairetsu.rb
  変数 = [a,b,c]
end

ハッシュ:複数のデータをまとめ、キーをつけることができる型

hash.rb
 変数 = { :key1 => a, :key2 => b }
end

引数

hikisu.rb
  puts 表示したいもの
  #表示したいものの部分が引数にあたる
end

addメソッド:戻り値を指定する

add.rb
  def add(a,b)
  a + b
  end
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0