What is Ruby?
Recently, we have seen Ruby everywhere. ProgramStaff> there are also several serialization issues. I really want to have a better understanding of it.
However, Baidu knows that only the following information can be provided:
Ruby is
Recently, I was working on a project using the rails framework and the ruby language. I personally don't feel very useful, and there are many problems with the framework and language.
Today, I encountered a very strange problem.CodeWIN32API is
Finally, I started to translate some Japanese sentences that I could not understand. I would like to ask the Japanese mm next to me.
MM read it for the first time, did not understand it, and did not understand it for the second time. Japanese ....
In the previous blog, such code 1 class songlist was used.
2 def [] (key)
3 return @ songs [Key] If key. kind_of? (Integer)
4 return @ songs. Find {| Asong. Name = key}
5 end
6end
In the fourth row, a method such as find can traverse the songs
Some time ago, I was working on an ERP project, and the performance of my notebook was poor (MB memory), so I could not do any development. In my spare time, I think of Ruby, a scripting language of interest. I had long wanted to explore Ruby, but
/* * $ ID: Ruby. c 571 23: 32: 14z elliotth $ * copyright (c) 2000-2001, thaddeus covert * copyright (c) 2002 Matthias Veit * copyright (c) 2004 Elliott Hughes * this source code is released for free distribution under the terms of the *
No function, with a half-day time to get the environment, with a half-day time familiar syntax, the function can be self-checked manual function query page in the http://www.rubycentral.com/ref/index.html function library official station in
1. Install JDK
Jdk-6u7-windows-i586-p.exe
2. Install instantrails
2.1 decompress the package in any directory.
InstantRails-2.0-win.zip
(Instantrails has a lot of built-in software and has been configured, for example, Ruby 1.8.6 rails 2.0.2 MySQL
1. system method. System is followed by the command string of the System Shell to be executed as the parameter. This method allows the system program to run in a sub-shell. This is a conventional method for booting external programs in the system
Ruby keywords yield
The ruby keyword yield is a commonly used keyword in actual programming. Programmers who have just learned the ruby language must first master the usage of this type of basic keywords.
Some basic keywords in ruby are essential
1.Create Regular Expression
A) reg1 =/^ [a-z] * $/# Place the schema definition between two forward slashes and return a Regexp object
B) reg2 = Regexp. new ('^ [a-z] * $') # create a Regexp object
C) reg3 = % r {^ [a-z] * $} # Use the frontend %
Module:
The module definition is similar to the class, and the module keyword is used. However, a module cannot be instantiated or quilt-type. modules are independent and a module is an instance of a module class. The two most common functions of a
Self Context
Ruby's self is similar to Java's this, but is quite different. Java methods are referenced in the instance method, so this generally points to the current object. Ruby code is executed row by row, so the context self has different
From: http://galeki.is-programmer.com/show/183.html
Like other oo languages, in ruby, object functions are completed by sending messages to objects, such as Str. upcase is the message that sends upcase to str. The vertex operator (.), it is used to
1. Win32ole
2. Rails plug-in Collection
3. How to Write a simple Rails Plugin
4. Create your own error message in Rails
5. Enhance the Automatic completion function of irb (words completion)
Irb-r irb/completion
6. Document
Today, the following Program has made me struggle for a long time. The concept of private in Ruby is really strange...
Class Test private def test_print puts 'test' endendclass Test2 you cannot call endendTest2.new by adding self here. private
Each
The simplest iterator is to access all elements collected continuously.
[1,3,5,7,9].each { |i| puts i }
Output result:
1
3
5
7
9
The unique function is to implement the for loop of the Ruby language. Because the built-in loop
The ruby class is a single inheritance creature, so there is a module, implementing multi-inheritance,
Note: The names of modules, constants, and classes start with an uppercase letter.
, Module reference:1. If the referenced module is in the same
For example, you write a class named SendMail and put it in a file named send_mail.rb,
If you attempt to reference this class in the same directory
Require "send_mail"
It's a waste of time, we need to add this paragraph
$:
This means that the
Record various problems and solutions encountered during Redmine mail synchronization Configuration
1. How to install RedmineHttp://www.redmine.org/projects/redmine/wiki/RedmineInstall
2. How to configure automatic email receiving and timed
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.