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
Great Britain
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Singapore
Hungary
Ukraine
Luxembourg
Estonia
Lithuania
South Korea
Turkey
Switzerland
Colombia
Taiwan
Chile
Norway
Ecuador
Indonesia
New Zealand
Cyprus
Denmark
Finland
Poland
Malta
Czechia
Austria
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Netherlands
Bulgaria
Latvia
South Africa
Malaysia
Japan
Slovakia
Philippines
Mexico
Thailand