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