[Ruby] Ruby basic terms

1 minute read

Programming beginners
I will summarize the basic terms of Ruby for output.

Ruby basic terms

1.Ruby
A programming language that allows you to create large web applications to small programs.
The extension is “.rb”

  1. ruby command
    A command that can perform various operations related to Ruby.
    Type in at the terminal.

3.irb(Interactive Ruby)
A function that allows you to run Ruby programs directly from the terminal.

  1. Formula expansion
    A function that allows you to put an expression inside a character string.
    All you have to do is type “# {expression} in the string”.

  2. Array
    A value that can have multiple values.
    Use [] to manage the values in order.
    The data in the array is called an “element”.

  3. Subscript
    The number assigned to each element of the array.
    Subscripts start with “0”.

  4. Hash
    A value that can have multiple values.
    Manage by key (name) and value (value) using {}.

  5. Class
    Defines common attributes and processing of values. Something like a blueprint.

  6. Instance
    Data created based on a class.

  7. Class method
    Method used for processing that uses common information in the class.
    Used by the class itself.

  8. Instance method
    Method used for processing using individual information for each instance.
    Used by the instance generated from “class that defines instance method”.

  9. Attributes and attribute values
    Attributes are information that is the nature of data.
    Attribute values are specific information that applies to each.

  10. Instance variables
    A variable that defines the attributes of the data.
    All instances can have the same attributes and individual instances can have different values.
    Add “@” at the beginning.

  11. Local variables
    A variable that defines the attributes of the data.
    It can be used only in the described instance method.

  12. initialize method
    An instance method that defines the processing that the created instance performs at the moment the instance is created.

16.Sinatra
One of the Ruby frameworks.
The processing speed is basically fast.
Since there are few existing functions, even beginners can easily build Web applications from scratch.
If you want to create a large-scale app, you need to customize it accordingly.

Summary

Strictly speaking, some terms are not “limited” to Ruby, but I will describe them because they are terms learned in learning Ruby.

Tags:

Updated: