The Book of Ruby by Huw Collingbourne
Author:Huw Collingbourne
Language: eng
Format: mobi, epub, pdf
Tags: COMPUTERS / Programming Languages / Ruby
Publisher: No Starch Press
Published: 2011-06-30T04:00:00+00:00
You can call a module’s module methods just as you would call a class’s class methods, using dot notation, like this:
MyModule.lose #=> "Sorry, you didn't win"
But how do you call an instance method? Neither of the following attempts succeeds:
puts( prize ) # Error: undefined local variable or method
puts( MyModule.prize ) # Error: undefined method 'prize'
In spite of their similarities, classes possess two major features that modules do not: instances and inheritance. Classes can have instances (objects created from the class), superclasses (parents), and subclasses (children); modules can have none of these. It is not possible to call an instance method from an instance of a module (a “module object”) for the simple reason that it is impossible to create instances of a module. This explains the errors when you try to call the prize method in the previous code.
Download
The Book of Ruby by Huw Collingbourne.epub
The Book of Ruby by Huw Collingbourne.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Hello! Python by Anthony Briggs(9928)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9802)
The Mikado Method by Ola Ellnestam Daniel Brolund(9787)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8310)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7790)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7772)
Grails in Action by Glen Smith Peter Ledbrook(7705)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7567)
Windows APT Warfare by Sheng-Hao Ma(6942)
Layered Design for Ruby on Rails Applications by Vladimir Dementyev(6672)
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition by Marcos Romero & Brenden Sewell(6539)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6424)
Kotlin in Action by Dmitry Jemerov(5074)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4323)
Solidity Programming Essentials by Ritesh Modi(4058)
Functional Programming in JavaScript by Mantyla Dan(4044)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3849)
Unity 3D Game Development by Anthony Davis & Travis Baptiste & Russell Craig & Ryan Stunkel(3792)
The Ultimate iOS Interview Playbook by Avi Tsadok(3771)
