📜  如何创建方法 ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:46.890000             🧑  作者: Mango

代码示例1
#start with 'def', name the method, add function, end with 'end'
def this_method_multiples_x_by_number_of_students
  x * number_of_students
end
# => class_name.this_method_multiples_x_by_number_of_students