ruby Assignment Notes

sponsored links
Tip: If reproduced please specify the author Small Game And provenance

ruby is very flexible, because of the flexibility so that we sometimes puzzled why do it in the end, ruby assignment should be noted there are many places

1. Array element assignment, in fact, an array assignment of the [] is also a function, put it when the function can be treated, if there are two parameters, then the form of him is

arr [x] = y is equivalent to arr. [] (x, y), if the three parameters, then it is in the form arr [x, y] = z is equivalent to arr. [] (x, y, z) other analogy

2. Parallel assignment, if there are multiple values to a left-right values, then the right value as an array with the value assigned to the left

a = 1, 2, 3 is equivalent to a = [1, 2, 3], to prevent this can be done a, = 1, 2, 3, then a = 1 a

3. When there are multiple left-value, a right value, then the ruby on the attempt to put the right value of expanded value assigned to the left, when an array of values to a number of left-right values, then disassemble the array then assign
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of ruby Assignment Notes

  • Rails source code analysis (4): Request / Response

    1) Rails defines two abstract class: AbstractRequest and AbstractResponse code is not posted, first take a look at Response. 2) is mainly responsible for the specific ctgi_process.rb main interface is responsible for implementation methods of impleme ...

  • flash chart summary

    pen Flash Chart is an open source Flash chart drawing tool, offers a variety of programming interfaces, including PHP, Ruby, Perl, Python, Java,. Net, AS, JS, etc. to generate a variety of data interfaces, and then Flash to display the function is to ...

  • Rails2.0.2 change the default DB adpter

    In Rails2.0.2 rails demo ... ... MissingSourceFile in SayController # hello no such file to load - sqlite3 RAILS_ROOT: / home / kenb / rails-projects / demo ... ... Checked config / database.yml, adpter default is set become the sqlite3. Check the ra ...

  • Using Rails Captcha plug-in, easy implementation Verification Code

    Simple Captcha Plugin Can help us easily in the Rails implementation of Verification Code function. In addition, he has the option to provide sufficient to meet the U.S. requirements for certification, the use of easy. Supported picture and digital authen

  • RSpec troubleshooting

    1.uninitialized constant Dependencies Conditions: In windows under way to install the RSpec gem and rspec-rails. However, in ruby script / spec_server to do the test under the spec your_spec.rb-X will appear uninitialized constant Dependencies (NameE ...

  • Alternative to Java with Ruby to do unit testing interface rest!

    Ruby is long overdue to replace java more flexible and make some necessary changes in a matter of, if not deep-rooted culture of the company's java, I think. . . . . . The following are my Writing for the Rest of the interface used to make the test su

  • Workspace run under different Eclipse

    Now do live more and more often required to use eclipse in java and ruby & rails project conducted between the tangential shear from the past, because in the rails project used a coloring Aptana preferences, the results open the java project sour ...

  • Hibernate Inteceptor

    The end of the project stage, the client suddenly put forward a very troublesome but normal demand, the system records all changes must be carried out. Formats such as: 2004.1.1 12:30 Ikuya wind orders Sales Order Date 2004.1.2-> 2004.1.3 The firs ...

  • Oracle instant clent for ruby / rails on cygwin

    Environment: XP: oracle full client, ruby, rails, gem cygwin: ruby rails, gem (the version with the XP version) Needs: for cygwin is installed under the rails platform support oci Steps: <1> download oracle instant client (10.2.0.3 Instant Client Pa

  • Ruby on Rails Routing - Simple Examples

    This article contains a list of ruby on rails routing examples. If you find you have any questions please leave a comment. Routes are processed from the top of routes.rb down. If a route is matched it will stop processing the routes.rb file and use that r

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries