Evgenii Legotckoi
Aug. 26, 2016, 1:56 p.m.

RubyUser Guide #28 - Ruby - Nuts and bolts

Ruby, ruby lesson, ruby уроки, user guide, руководство пользователя

This chapter addresses a few practical issues.

Statement delimiters

Some languages require some kind of punctuation, often a semicolon (

  1. ;
), to end each statement in a program. Ruby instead follows the convention used in shells like
  1. sh
and …

Read
Evgenii Legotckoi
Aug. 26, 2016, 1:52 p.m.

RubyUser Guide #27 - Ruby - Object initialization

Ruby, ruby lesson, ruby уроки, user guide, руководство пользователя

Our Fruit class from the previous chapter had two instance variables, one to describe the kind of fruit and another to describe its condition. It was only after writing a custom

  1. inspect
method for the class that we realized it …

Read
Evgenii Legotckoi
Aug. 26, 2016, 1:21 p.m.

RubyUser Guide #26 - Ruby - Accessors

Ruby, ruby lesson, ruby уроки, user guide, руководство пользователя

What is an accessor?

We briefly discussed instance variables in an earlier chapter, but haven't done much with them yet. An object's instance variables are its attributes, the things that distinguish it from other objects of the same class. It …

Read
Evgenii Legotckoi
Aug. 26, 2016, 1:18 p.m.

RubyUser Guide #25 - Ruby - Exception processing: ensure

Ruby, ruby lesson, ruby уроки, user guide, руководство пользователя

There may be cleanup work that is necessary when a method finishes its work. Perhaps an open file should be closed, buffered data should be flushed, etc. If there were always only one exit point for each method, we could …

Read
Evgenii Legotckoi
Aug. 26, 2016, 1:09 p.m.

RubyUser Guide #24 - Ruby - Exception processing: rescue

Ruby, ruby lesson, ruby уроки, user guide, руководство пользователя

An executing program can run into unexpected problems. A file that it wants to read might not exist; the disk might be full when it wants to save some data; the user may provide it with some unsuitable kind of …

Read
Evgenii Legotckoi
Aug. 25, 2016, 1:05 p.m.

RubyUser Guide #23 - Ruby - Class constants

class, constants, Ruby, Ruby уроки, user guide, руководство пользователя

A constant has a name starting with an uppercase character. It should be assigned a value at most once. In the current implementation of ruby, reassignment of a constant generates a warning but not an error (the non-ANSI version of …

Read
Evgenii Legotckoi
July 10, 2016, 1:03 p.m.

RubyUser Guide #22 - Ruby - Local variables

local variables, Ruby, ruby lesson, ruby уроки, user guide, локальные переменные, руководство пользователя

A local variable has a name starting with a lower case letter or an underscore character (_). Local variables do not, like globals and instance variables, have the value nil before initialization:

  1. ruby> $foo
  2. nil
  3. ruby> @foo
  4. nil
  5. ruby> foo
Read
Evgenii Legotckoi
July 10, 2016, 1:01 p.m.

RubyUser Guide #21 - Ruby - Instance variables

Instance variables, Ruby, ruby lesson, ruby уроки, user guide, переменные класса, руководство пользователя

An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance …

Read
Evgenii Legotckoi
June 29, 2016, 12:59 p.m.

RubyUser Guide #20 - Ruby - global variables

global variables, Ruby, ruby lesson, ruby уроки, user guide, глобальные переменные, руководство пользователя

A global variable has a name beginning with $. It can be referred to from anywhere in a program. Before initialization, a global variable has the special value nil.

  1. ruby> $foo
  2. nil
  3. ruby> $foo = 5
  4. 5
  5. ruby> $foo
  6. 5
Read
Evgenii Legotckoi
June 29, 2016, 12:57 p.m.

RubyUser Guide #19 - Ruby - variables

Ruby, ruby lesson, ruby уроки, user guide, variables, переменные, руководство пользователя

Ruby has three kinds of variables, one kind of constant and exactly two pseudo-variables. The variables and the constants have no type. While untyped variables have some drawbacks, they have many more advantages and fit well with ruby's quick and …

Read
  • Last comments
  • AK
    April 1, 2025, 11:41 a.m.
    Добрый день. В данный момент работаю над проектом, где необходимо выводить звук из программы в определенное аудиоустройство (колонки, наушники, виртуальный кабель и т.д). Пишу на Qt5.12.12 поско…
  • Evgenii Legotckoi
    March 9, 2025, 9:02 p.m.
    К сожалению, я этого подсказать не могу, поскольку у меня нет необходимости в обходе блокировок и т.д. Поэтому я и не задавался решением этой проблемы. Ну выглядит так, что вам действитель…
  • VP
    March 9, 2025, 4:14 p.m.
    Здравствуйте! Я устанавливал Qt6 из исходников а также Qt Creator по отдельности. Все компоненты, связанные с разработкой для Android, установлены. Кроме одного... Когда пытаюсь скомпилиров…
  • ИМ
    Nov. 22, 2024, 9:51 p.m.
    Добрый вечер Евгений! Я сделал себе авторизацию аналогичную вашей, все работает, кроме возврата к предидущей странице. Редеректит всегда на главную, хотя в логах сервера вижу запросы на правильн…
  • Evgenii Legotckoi
    Oct. 31, 2024, 11:37 p.m.
    Добрый день. Да, можно. Либо через такие же плагины, либо с постобработкой через python библиотеку Beautiful Soup