Ruby contains "! "And no "! "The biggest difference between methods is that "! "Will change the calling object itself. For example, str. gsub (/A/, 'B') does not change STR itself, but only returns a new Str. Str. gsub! (/A/, 'B') will change the
In many cases, when you design your applicationProgramYou may want to implement a method that is only used inside an object rather than other objects. Ruby provides three keywords to restrict access to methods.
· PRIVATE: Only methods
A very simple file is the example (http://www.ruby-cn.org/book/ProgrammingRuby/ext_ruby.html) on programming Ruby, and if the extension is CPP, the following error occurs:
Error c2664: 'rb _ define_method ': cannot convert parameter 3 from'Unsigned
Net: SMTP is easy to send emails, but it does not support sending attachments directly. You can install mailfactory to implement this function.
1) install mailfactory
Run: Gem install mailfactory
2) supports Chinese
The mailfactory
1. NotesThe comment starts with # and ends with the end of the line.If the # character appears in a string or regular expression literal, it serves as part of the string or regular expression rather than introducing a comment.# This entire line is a
Next we will introduce a commonly used IDE development tool. We believe you are familiar with netbeans and eclipse. Here I will mainly introduce netbeans as the main tool, if you want to know how to build Ruby in eclipse, you can search for relevant
Since last year, JavaCommunityStart to discuss a "new"Programming Language: Ruby: the scope of this discussion is growing and more participants are involved. Even Gosling, the father of Java, is involved. However, the common understanding is that
Many documents describe how to use the gem (one-click Ruby installer is already included, and you can use the gem after installation) for Remote Installation. If the network is poor, the installation will fail. I can see an article on the Internet
Ruby Study Notes
Ruby usageThe first half of RubyWe are defining, we are creatingFor example, blue_crystal = 1, leaf_records = 5
The second half of RubyPutting things in motionFor example, pipe. catch_a_star
Conclusion: 1. Defining things 2.
Another classmate wrote a slightly garbled blog, revealing a yearning for "everyone still uses Java. Let alone the article itself. Just talked to Paul hammant about jruby in recent days. To put it simply, a classmate's guess is just a guess.
The
Document directory
About Style
About Dynamics
Structure
Others
Usage
/*************************************** *
Call by name
Everything is an object and never closes
Hook everywhere
Yield/block/proc/Lambda, first-class citizen
Symbol and
Due to work relationships, I have never had time to learn Ruby. Recently, I finally had time to learn Ruby. I also opened a blog on csdn to record my learning experience, of course, it's not just Ruby. In recent years, dynamic languages have been
Exception Handling is a common problem in the development process. Basically, all advanced languages have their own exception handling systems. Ruby is no exception and is easy to use.
The raise method is used to throw exceptions in Ruby. Remember,
So which of the three ages is the best to use on your project? That depends a great deal on what you want to accomplish. to wrap up the book, I 've outlined some of the pros and cons of each language in this section. which of the three languages is
Songben launched Ruby 1.9 on Christmas Day. According to Ruby's convention, if the first digit after the decimal point is a singular number, it indicates that this is an experimental version and is not recommended for product environments. The
The ruby method can accept code blocks as parameters, which is a very flexible method and a very good design idea. Suppose there are three methods as shown in 1:
Figure 1
As shown in figure 1, a large number of code blocks of method A, Method B, and
Well, our function test code often has a small requirement: When a function in the test code throws an exception, the system automatically displays a debugging window. The debugging window should contain context information for the tester to debug
I am very busy recently. Work from morning till night. Do not write a blog. You don't even have time to read a blog. Although I have always wanted to gossip about JavaScript, And I have betrayed the revolution, I can't leave it blank. However, I can'
I recently read the basic syntax section of [ironruby unleashed feb.2010] and found that "use a different..." appears in many places in the book.
Indeed, many basic operations in Ruby provide many methods/aliases, and many odd syntax (sugar ). In
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service