In this chapter, you were introduced to methods in Ruby and what methods return. We also examined the two types of method available in Ruby programs. The difference between the two method types may seem subtle right now; however, the difference between method types reveals itself when working with Ruby on Rails applications. For now, the key takeaway is that there are two options for method types in Ruby. This chapter also walked you through a close cousin to methods: the proc. We also saw what lambdas are and how to encapsulate entire blocks of behavior with lambdas. Additionally, we walked through how to pass arguments to lambdas in order to have data-driven features. We examined the key differences between procs and lambdas. We also looked at the various ways to pass arguments to methods. We analyzed how to implement splat and optional arguments in methods which allow...
United States
United Kingdom
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Argentina
Austria
Belgium
Bulgaria
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
Greece
Hungary
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Singapore
Slovakia
Slovenia
South Africa
South Korea
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine