Category:Ruby

  • Deep analysis of ruby variables

    Time:2021-10-24

    variableIs a storage location that holds any data that can be used by any program. RubyFive types of variables are supported. Generally, it starts with lowercase letters and underscores: variables. $starts with global variable. @Beginning: instance variable. @@Start: class variable class variables are shared throughout the inheritance chain Start with a capital letter: constant. Ruby […]

  • Ruby object-oriented knowledge summary

    Time:2021-10-23

    Ruby is a pure object-oriented language. Everything in Ruby appears in the form of objects. Every value in ruby is an object, even the most primitive things: strings, numbers, and even true and false are objects. Class itself is also an object and an instance of class. This chapter will show you all the main […]

  • Ruby uses eventmachine to add file download capabilities to the HTTP server

    Time:2021-10-22

    Idea:Use ruby eventmachine and EM HTTP server gem to complete a simple httpserver that provides file download function;EM FileStreamer is used to send files asynchronously. When sending files, header is first assembled and FileStreamer is called. code: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 […]

  • Notes on basic learning of ruby metaprogramming

    Time:2021-10-21

    Note 1:The code contains variables, classes and methods, which are collectively referred to as language construct. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # test.rb class Greeting  def initialize(text)   @text = text  end    def welcome   @text  end end my_obj = Greeting.new(“hello”) […]

  • Summary of ruby iterator knowledge

    Time:2020-9-24

    In short: iteration refers to doing the same thing repeatedly, so iterator is used to repeat the same things many times. Iterators are collection supported methods. Objects that store a set of data members are called collections. In ruby, arrays and hashes can be called collections. Iterators return all elements of the collection, one after […]

  • In depth analysis of ruby variables

    Time:2020-9-23

    A variable is a storage location that holds any data that can be used by any program. Ruby supports five types of variables. General lowercase letters, the beginning of the underline: variable. $starts with: global variable. @Beginning: instance variable. @@Start: class variables are shared in the entire inheritance chain Start with a capital letter: constant. […]

  • Object oriented knowledge summary of ruby

    Time:2020-9-22

    Ruby is a pure object-oriented language. Everything in ruby is in the form of objects. Every value in ruby is an object, even the most primitive things: strings, numbers, even true and false. A class itself is an object, an instance of a class. This chapter will show you all the main features related to […]

  • Print does not wrap, puts will wrap page 1 / 2

    Time:2020-6-17

    1. Print does not automatically wrap lines, and puts will automatically wrap lines. If a line is not enough, you can add “\” to connect Ruby code puts 6/2 Operation result: Ruby code Three 2. = =, EQL? Equal? Difference ==Equal value equal value equal value equal type equal value equal memory address equal A=1 […]

  • Download and installation of ruby under windows and Linux

    Time:2020-6-16

    Here you can download the latest Ruby Version for you. The current stable version is 1.8.6. Please read before downloadingRuby open source license 。 Ruby source code If you want to make it more compatible with your platform or need to set up your environment specifically, installing from source is the best solution. This is […]

  • A good collection of e-book download addresses about Ruby

    Time:2020-6-15

    Ruby doesn’t have many books. I collected these books from the Internet. Download them and click the picture directly Programming ruby, Second Edition: an introduction to ruby, Second Edition, required reading for learning Ruby (UPDATED)Agile web development with rails: beta 2. Based on rails 1.2 (UPDATED)The ruby way is now the second version updated to […]

  • Getting started with Ruby – Ruby installation

    Time:2020-6-14

    For Ruby installation, you can go to the official website of ruby to download the windows installation package of ruby 1.56. After installation, open the DOS window and input ruby-v display Ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] indicates that Ruby has been installed successfully. The version number is ruby 1.96.   After installation, ruby-186-20 appears […]

  • 20 minutes to teach you Ruby quick start picture and text tutorial page 1 / 4

    Time:2020-6-13

    All of a sudden, ruby is also good. I’m going to learn itintroduceThis is a short introduction to ruby. It only takes 20 minutes to read it completely. Let’s assume that the reader has installed ruby. If you haven’t, please visit the official Ruby website to download and install it before reading this article. Interactive […]