definition of ruby method

For output. I will easily output the method definition of ruby.

Simple def method name for usage              end

For example, the following unused patterns

puts "1"
puts "2"
puts "3"
puts "4"
puts "5"
puts "6"
puts "7"
puts "8"
puts "9"
puts "10"

puts "1"
puts "2"
puts "3"
puts "4"
puts "5"
puts "6"
puts "7"
puts "8"
puts "9"
puts "10"

puts "1"
puts "2"
puts "3"
puts "4"
puts "5"
puts "6"
puts "7"
puts "8"
puts "9"
puts "10"

Pattern used

def number_count
  puts "1"
  puts "2"
  puts "3"
  puts "4"
  puts "5"
  puts "6"
  puts "7"
  puts "8"
  puts "9"
  puts "10"
end

number_count
number_count
number_count

The output result is the same.

Basically def end is until the method is loaded It will be skipped, so be careful about that

I'm having trouble with rails, so it's a basic thing I want to keep down.

Recommended Posts

definition of ruby method
[Ruby] Method definition summary
Ruby algorithm (inject, method definition)
Ruby to_s method
Basics of Ruby
[Ruby] initialize method
Ruby build method
Ruby accessor method
ruby map method
Ruby Thread # [] = method notes
Definition of Android constants
Integer check method with ruby
[Ruby] List of basic commands
[Ruby] Notes on gets method
[Ruby] Method that returns truth
Benefits of Java static method
[ruby] Method call with argument
[Ruby] Questions and verification about the number of method arguments
About the behavior of ruby Hash # ==
[Ruby] Method to count specific characters
Extraction of "ruby" double hash * Review
Basic knowledge of Ruby on Rails
Consideration of Routing of form_with helper method
[Ruby basics] split method and to_s method
Ruby 5 or higher sum of integers
About the role of the initialize method
Basics of Ruby ~ Review of confusing parts ~
Ruby / Rust linkage (6) Extraction of morphemes
Impressions of making BlackJack-cli with Ruby
Ruby memorandum (acquisition of key value)
[Ruby on Rails] Convenient helper method
What kind of method is define_method?
Explanation about Array object of Ruby
How to use Ruby inject method
Ruby Basics 2 ~ Review of confusing parts ~
[Ruby] Display the contents of variables
Iterative processing of Ruby using each method (find the sum from 1 to 10)
[Ruby] Let's examine the inheritance tree while watching the flow of method search
[Ruby on Rails] Introduction of initial data
Gem list of each ruby version 2.5.x
Implementation of clone method for Java Record
Make a note of Ruby keyword arguments
[Rails] Addition of Ruby On Rails comment function
Directory information of DEFAULT_CERT_FILE in Mac ruby 2.0.0
Dharma doll drop of characters (ruby edition)
Ruby on Rails installation method [Mac edition]
[Ruby] From the basics to the inject method
Implemented "Floyd Cycle Detection Method" in Ruby
Explanation of Ruby Time and Date objects
Summary of hashes and symbols in Ruby
Ruby print puts p printf output method
[Ruby] Cut off the contents of twitter-ads
Extract a part of a string with Ruby
[Ruby on Rails] Japanese notation of errors
Summary of CR, LF, CRL of open method
[Ruby] Classification and usage of loops in Ruby
Deepened my understanding of the merge method
Explanation of Ruby on rails for beginners ①
Comparison of JavaScript objects and Ruby classes
Extract characters from Ruby strings slice method
[Ruby on rails] Implementation of like function