Evgenii Legotckoi
Evgenii LegotckoiJune 27, 2016, 2:43 a.m.

RubyUser Guide #15 - Ruby - access control

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

Earlier, we said that ruby has no functions, only methods. However there is more than one kind of method. In this chapter we introduce access controls .

Consider what happens when we define a method in the "top level", not …

Read
Evgenii Legotckoi
Evgenii LegotckoiJune 27, 2016, 2:41 a.m.

RubyUser Guide #14 - Ruby - Redefinition of methods

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

In a subclass, we can change the behavior of the instances by redefining superclass methods.

ruby> class Human
    |   def identify
    |     print "I'm a person.\n"
    |   end
    |   def train_toll(age)
    |     if age < 12
    |       print "Reduced fare.\n"; …
Read
Evgenii Legotckoi
Evgenii LegotckoiJune 27, 2016, 2:38 a.m.

RubyUser Guide #13 - Ruby - Inheritance

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

Our classification of objects in everyday life is naturally hierarchical. We know that all cats are mammals , and all mammals are animals . Smaller classes inherit characteristics from the larger classes to which they belong. If all mammals breathe, …

Read
Evgenii Legotckoi
Evgenii LegotckoiJune 26, 2016, 2:36 a.m.

RubyUser Guide #12 - Ruby - classes

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

The real world is filled by objects, and we can classify them. For example, a very small child is likely to say "bow-wow" when seeing a dog, regardless of the breed; we naturally see the world in terms of these …

Read
Evgenii Legotckoi
Evgenii LegotckoiJune 26, 2016, 2:34 a.m.

RubyUser Guide #11 - Ruby - methods

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

What is a method? In OO programming, we don't think of operating on data directly from outside an object; rather, objects have some understanding of how to operate on themselves (when asked nicely to do so). You might say we …

Read
Evgenii Legotckoi
Evgenii LegotckoiJune 26, 2016, 2:24 a.m.

RubyUser Guide #10 - Ruby - Object-oriented thinking

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

Object oriented is a catchy phrase. To call anything object oriented can make you sound pretty smart. Ruby claims to be an object oriented scripting language; but what exactly does "object oriented" mean?

There have been a variety of answers …

Read
Evgenii Legotckoi
Evgenii LegotckoiJune 25, 2016, 2:22 a.m.

RubyUser Guide #09 - Ruby - iterators

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

Iterators are not an original concept with ruby. They are in common use in object-oriented languages. They are also used in Lisp, though there they are not called iterators. However the concepet of iterator is an unfamiliar one for many …

Read
Evgenii Legotckoi
Evgenii LegotckoiJune 25, 2016, 2:07 a.m.

RubyUser Guide #08 - Ruby - control structures

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

This chapter explores more of ruby's control structures.

case

We use the case statement to test a sequence of conditions. This is superficially similar to switch in C and Java but is considerably more powerful, as we shall see.

ruby> …
Read
Evgenii Legotckoi
Evgenii LegotckoiJune 23, 2016, 2:01 a.m.

RubyUser Guide #07 - Ruby - Back to the simple examples

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

Now let's take apart the code of some of our previous example programs.

The following appeared in the simple examples chapter.

def fact(n)
  if n == 0
    1
  else
    n * fact(n-1)
  end
end
print fact(ARGV[0].to_i), "\n"

Because this is …

Read
Evgenii Legotckoi
Evgenii LegotckoiJune 21, 2016, 1:54 a.m.

RubyUser Guide #06 - Ruby - arrays

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

You can create an array by listing some items within square brackets ([]) and separating them with commas. Ruby's arrays can accomodate diverse object types.

ruby> ary = [1, 2, "3"]
   [1, 2, "3"]

Arrays can be concatenated or repeated …

Read
Evgenii Legotckoi
Evgenii LegotckoiJune 21, 2016, 1:52 a.m.

RubyUser Guide #05 - Ruby - Regular expressions

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

Let's put together a more interesting program. This time we test whether a string fits a description, encoded into a concise pattern .

There are some characters and character combinations that have special meaning in these patterns, including:

[] - …

Read
Evgenii Legotckoi
Evgenii LegotckoiJune 18, 2016, 1:49 a.m.

RubyUser Guide #04 - Ruby - Strings

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

Ruby deals with strings as well as numerical data. A string may be double-quoted ("...") or single-quoted ('...').

ruby> "abc"
   "abc"
ruby> 'abc'
   "abc"

Double- and single-quoting have different effects in some cases. A double-quoted string allows character escapes by …

Read
AD

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:50points,
  • Rating points-4
m

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:80points,
  • Rating points4
m

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:20points,
  • Rating points-10
Last comments
Evgenii Legotckoi
Evgenii LegotckoiNov. 1, 2024, 12:37 a.m.
Django - Lesson 064. How to write a Python Markdown extension Добрый день. Да, можно. Либо через такие же плагины, либо с постобработкой через python библиотеку Beautiful Soup
A
ALO1ZEOct. 19, 2024, 6:19 p.m.
Fb3 file reader on Qt Creator Подскажите как это запустить? Я не шарю в программировании и кодинге. Скачал и установаил Qt, но куча ошибок выдается и не запустить. А очень надо fb3 переконвертировать в html
ИМ
Игорь МаксимовOct. 5, 2024, 5:51 p.m.
Django - Lesson 064. How to write a Python Markdown extension Приветствую Евгений! У меня вопрос. Можно ли вставлять свои классы в разметку редактора markdown? Допустим имея стандартную разметку: <ul> <li></li> <li></l…
d
dblas5July 5, 2024, 9:02 p.m.
QML - Lesson 016. SQLite database and the working with it in QML Qt Здравствуйте, возникает такая проблема (я новичок): ApplicationWindow неизвестный элемент. (М300) для TextField и Button аналогично. Могу предположить, что из-за более новой верси…
k
kmssrFeb. 9, 2024, 5:43 a.m.
Qt Linux - Lesson 001. Autorun Qt application under Linux как сделать автозапуск для флэтпака, который не даёт создавать файлы в ~/.config - вот это вопрос ))
Now discuss on the forum
m
moogoNov. 22, 2024, 6:17 p.m.
Mosquito Spray System Effective Mosquito Systems for Backyard | Eco-Friendly Misting Control Device & Repellent Spray - Moogo ; Upgrade your backyard with our mosquito-repellent device! Our misters conce…
Evgenii Legotckoi
Evgenii LegotckoiJune 25, 2024, 1:11 a.m.
добавить qlineseries в функции Я тут. Работы оень много. Отправил его в бан.
t
tonypeachey1Nov. 15, 2024, 5:04 p.m.
google domain [url=https://google.com/]domain[/url] domain [http://www.example.com link title]
NSProject
NSProjectJune 4, 2022, 1:49 p.m.
Всё ещё разбираюсь с кешем. В следствии прочтения данной статьи. Я принял для себя решение сделать кеширование свойств менеджера модели LikeDislike. И так как установка evileg_core для меня не была возможна, ибо он писался…

Follow us in social networks