1. Search for the begin statement first, and execute the statement if it is found; otherwise, execute
ProgramThe first line
2. When it comes to function definitions, class definitions, and module definitions, these things are defined.
3. Run
A real variable starts with @ and Its range is limited to the self object. two different objects can have real variables with different values even if they belong to the same class. from outside the object, real variables cannot be changed or even
The behavior of an object depends on its class, but we often know that a specific object requires a specific behavior. in many languages, we have to get into the trouble of defining another class, even if it is only used for the next ing. in Ruby,
Object-oriented It is a confusing wording. object orientation makes others think you are fashionable. ruby claims to be an object-oriented scripting language, but what exactly is "Object-Oriented "? We already have a variety of answers, but all
You can create an array by listing elements in square brackets and separating them with commas (,). The ruby array can adapt to different object types.
Ruby> ary = [1, 2, "3"][1, 2, "3"]
Just like the string mentioned above, Arrays can be
# Scanweb. Rb
# Use Ruby scanweb. RB www.jb51.net to save the current result in c: \ 1.txt
Require 'net/http'Filename = file. New ('C: \ 1.txt ', "W + ")If $ * [0] = NilPuts "hehe, no URL entered"ElseH = net: http. New ($ * [0], 80)Resp, Data =
The new version of will_paginate has abandoned this practice and switched to the Gem method. This article builds an application named foobar to understand the usage of will_paginate.
====================================
C: \> rails foobar-D
Global variables start with $. They can be accessed anywhere in the program. Before initialization, the global variables have a special value nil.
Ruby> $ fooNilRuby> $ foo = 55Ruby> $ foo5
Use global variables with caution. they are quite
A vulnerability hostname check bypassed was found in the OpenSSL implementation binding version of Ruby. This vulnerability is caused by incorrect parsing of null bytes in the X509 name, which can be placed by attackers"Www.ruby-lang.org \
The Ruby language has many special functions that deserve further research. For example, the syntax is different from that of other programming languages. Here we will understand some concepts related to Ruby's special syntax.
Basic Syntax of
Ruby has some special modules that are useful. For example, the Ruby module OpenURI introduced here is a common Ruby module. We need to be familiar with its features.
Ruby on Rails directory files
Ruby function pointer concepts
Ruby Rmagick
The Ruby language is widely used and can be used in a simple and flexible way to help us implement many functional requirements. Ruby parses Json in a very simple way.
Ruby special syntax concepts
Example of Ruby code for getting the current
The use of the Ruby language can help us implement many functions. For example, this article will introduce you to the implementation methods for creating XML in Ruby, which is one of them.
Ruby module Win32API calls win32API directly
How to call
Note: This is an article praising Ruby !!! It's not too late.
Note: This is an article about subjective consciousness. It does not aim to persuade you to use or not use Ruby, or any other technology. The Environment involved in this article is Web
The behavior of an object depends on its class, but we often know that a specific object requires a specific behavior. in many languages, we have to get into the trouble of defining another class, even if it is only used for the next ing. in Ruby,
We always want to classify unknown events. When it happens, passing a piece of code as a parameter to other methods is the easiest solution, that is, we want to process code like processing data.A new process object can be created through proc:Ruby>
When a method ends, we may need to clean it up. maybe an open file needs to be closed, and the data in the buffer zone should be cleared. if there is always only one exit point for each method, we can safely put our cleaning code in one place and
Some important differences between ruby and c # are as follows:1. ruby is a dynamic language, and c # Is a static language-that is, after an object is new, ruby can dynamically add some attributes or methods to the object instance (as does
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.