From 936e941de6022fc9193535fdfb01b3e724a328e9 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Tue, 3 Sep 2019 13:12:19 +0900 Subject: [PATCH 1/2] `class Fixnum` to `class Integer` in documentation/ruby-from-other-languages by `git grep -l 'class Fixnum' | xargs perl -pli -e 's/Fixnum/Integer/'` After Integer unification in Ruby 2.4.0, users should use `class Integer` instead of `class Fixnum`. Only de documentation mentions Active Support's `#hours`. It may be `Numeric#hours`. But I don't care it. --- bg/documentation/ruby-from-other-languages/index.md | 10 +++++----- de/documentation/ruby-from-other-languages/index.md | 10 +++++----- en/documentation/ruby-from-other-languages/index.md | 10 +++++----- es/documentation/ruby-from-other-languages/index.md | 10 +++++----- fr/documentation/ruby-from-other-languages/index.md | 10 +++++----- id/documentation/ruby-from-other-languages/index.md | 10 +++++----- it/documentation/ruby-from-other-languages/index.md | 10 +++++----- ja/documentation/ruby-from-other-languages/index.md | 10 +++++----- ko/documentation/ruby-from-other-languages/index.md | 10 +++++----- pl/documentation/ruby-from-other-languages/index.md | 10 +++++----- pt/documentation/ruby-from-other-languages/index.md | 10 +++++----- ru/documentation/ruby-from-other-languages/index.md | 10 +++++----- tr/documentation/ruby-from-other-languages/index.md | 10 +++++----- vi/documentation/ruby-from-other-languages/index.md | 10 +++++----- zh_cn/documentation/ruby-from-other-languages/index.md | 8 ++++---- zh_tw/documentation/ruby-from-other-languages/index.md | 10 +++++----- 16 files changed, 79 insertions(+), 79 deletions(-) diff --git a/bg/documentation/ruby-from-other-languages/index.md b/bg/documentation/ruby-from-other-languages/index.md index 04c66bfeb4..e29137633f 100644 --- a/bg/documentation/ruby-from-other-languages/index.md +++ b/bg/documentation/ruby-from-other-languages/index.md @@ -259,12 +259,12 @@ t1 == t2 ### Отворени класове Класовете в Ruby могат винаги да бъдат отворени, за да се допълват и променят. -Всеки вграден клас от стандартната библиотека, като `Fixnum` или дори `Object`, +Всеки вграден клас от стандартната библиотека, като `Integer` или дори `Object`, родителят на всички обекти, може да бъде променен. Ruby on Rails дефинира -множество методи за употребата на дати и времена във `Fixnum`. Пример: +множество методи за употребата на дати и времена във `Integer`. Пример: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # number of seconds in an hour end @@ -373,10 +373,10 @@ method(:puts).call "puts is an object!" ### Операторите са синтактична захар Повечето оператори са "синтактична захар" за извиквания на методи. Може -например да се предифинира `Fixnum#+`: +например да се предифинира `Integer#+`: {% highlight ruby %} -class Fixnum +class Integer # You can, but please don't do this def +(other) self - other diff --git a/de/documentation/ruby-from-other-languages/index.md b/de/documentation/ruby-from-other-languages/index.md index a7809b46e9..c0e408c988 100644 --- a/de/documentation/ruby-from-other-languages/index.md +++ b/de/documentation/ruby-from-other-languages/index.md @@ -292,12 +292,12 @@ t1 == t2 ### Offene Klassen Ruby-Klassen sind offen. Du kannst sie jeder Zeit verändern und ihnen -Methoden hinzufügen. Sogar eingebaute Klassen wie `Fixnum` oder `Object` -(die Mutter aller Objekte) sind erweiterbar. ActiveSupport fügt `Fixnum` +Methoden hinzufügen. Sogar eingebaute Klassen wie `Integer` oder `Object` +(die Mutter aller Objekte) sind erweiterbar. ActiveSupport fügt `Integer` viele Methoden zur Erzeugung von Zeitangaben hinzu: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # Anzahl der Sekunden in einer Stunde end @@ -418,10 +418,10 @@ method(:puts).call "puts ist ein Objekt!" Die meisten Operatoren in Ruby sind nur Methodenaufrufe mit einer speziellen Syntax (und ein paar Vorrangregeln). Du kannst zum Beispiel -die Methode `+` für `Fixnum` überschreiben: +die Methode `+` für `Integer` überschreiben: {% highlight ruby %} -class Fixnum +class Integer # Du kannst, aber bitte tu es nicht. def +(other) self - other diff --git a/en/documentation/ruby-from-other-languages/index.md b/en/documentation/ruby-from-other-languages/index.md index 10c144185c..3d68ed59a7 100644 --- a/en/documentation/ruby-from-other-languages/index.md +++ b/en/documentation/ruby-from-other-languages/index.md @@ -270,12 +270,12 @@ t1 == t2 ### Classes are open Ruby classes are open. You can open them up, add to them, and change them at -any time. Even core classes, like `Fixnum` or even `Object`, the parent of all +any time. Even core classes, like `Integer` or even `Object`, the parent of all objects. Ruby on Rails defines a bunch of methods for dealing with time on -`Fixnum`. Watch: +`Integer`. Watch: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # number of seconds in an hour end @@ -390,11 +390,11 @@ method(:puts).call "puts is an object!" ### Operators are syntactic sugar Most operators in Ruby are just syntactic sugar (with some precedence -rules) for method calls. You can, for example, override Fixnum’s `+` +rules) for method calls. You can, for example, override Integer’s `+` method: {% highlight ruby %} -class Fixnum +class Integer # You can, but please don't do this def +(other) self - other diff --git a/es/documentation/ruby-from-other-languages/index.md b/es/documentation/ruby-from-other-languages/index.md index c71b780e8c..f5392b12a0 100644 --- a/es/documentation/ruby-from-other-languages/index.md +++ b/es/documentation/ruby-from-other-languages/index.md @@ -286,12 +286,12 @@ t1 == t2 Las clases de Ruby están abiertas. Puedes abrirlas, agregarles funcionalidad y modificarlas en cualquier momento. Incluso las clases -principales, como `Fixnum` o incluso `Object`, el padre de todos los +principales, como `Integer` o incluso `Object`, el padre de todos los objetos. Ruby on Rails define un montón de métodos para manejar el -tiempo y los horarios en `Fixnum`. Mira: +tiempo y los horarios en `Integer`. Mira: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # cantidad de segundos en una hora end @@ -410,10 +410,10 @@ method(:puts).call "¡puts es un objeto!" La mayoría de los operadores en Ruby son simples simplificaciones sintácticas (con algunas reglas de precedencia) para llamar a ciertos -métodos. Puedes, por ejemplo, redefinir el método `Fixnum#+`\: +métodos. Puedes, por ejemplo, redefinir el método `Integer#+`\: {% highlight ruby %} -class Fixnum +class Integer # Puedes, pero por favor no lo hagas def +(otro) self - otro diff --git a/fr/documentation/ruby-from-other-languages/index.md b/fr/documentation/ruby-from-other-languages/index.md index 43a23a5577..3f7dac791d 100644 --- a/fr/documentation/ruby-from-other-languages/index.md +++ b/fr/documentation/ruby-from-other-languages/index.md @@ -285,12 +285,12 @@ t1 == t2 Ouvertes à la modification, à tout moment. Vous pouvez y faire des ajouts, les modifier durant l’exécution. Y compris les classes -standards, telles que `Fixnum`, voire `Object`, la classe parente de +standards, telles que `Integer`, voire `Object`, la classe parente de toute autre. Par exemple, l’application Ruby on Rails défini nombre de -méthodes pour traiter le temps, au sein de `Fixnum`. Voyez ceci : +méthodes pour traiter le temps, au sein de `Integer`. Voyez ceci : {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # nombre de secondes dans une heure end @@ -412,10 +412,10 @@ method(:puts).call "puts est un objet !" La plupart des opérateurs ne sont là que pour faciliter la vie du programmeur (et gèrent aussi les règles de priorité mathématique). Vous -pouvez, par exemple, redéfinir la méthode `+` de la classe `Fixnum`\: +pouvez, par exemple, redéfinir la méthode `+` de la classe `Integer`\: {% highlight ruby %} -class Fixnum +class Integer # Possible, mais pas recommandé... def +(other) self - other diff --git a/id/documentation/ruby-from-other-languages/index.md b/id/documentation/ruby-from-other-languages/index.md index cffedb9a37..657faab263 100644 --- a/id/documentation/ruby-from-other-languages/index.md +++ b/id/documentation/ruby-from-other-languages/index.md @@ -293,13 +293,13 @@ t1 == t2 Kelas Ruby bersifat terbuka. Anda bisa membuka `Class`, lalu menambahkan ke dalam `Class`, dan menggantinya kapan saja. Bahkan kelas yang -termasuk class inti, seperti kelas `Fixnum` atau bahkan kelas `Object`, +termasuk class inti, seperti kelas `Integer` atau bahkan kelas `Object`, induk dari semua obyek di Ruby. Ruby on Rails mendefinisikan banyak -metode yang berhubungan dengan waktu ke dalam kelas `Fixnum`. Perhatikan +metode yang berhubungan dengan waktu ke dalam kelas `Integer`. Perhatikan kode berikut: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # total detik dalam satu jam adalah 3600 end @@ -431,10 +431,10 @@ Kebanyakan operator di Ruby hanyalah *syntactic sugar*. Maksudnya operator-operator itu, mereka sebenarnya hanyalah pemanggilan metode saja, tentunya dengan peraturan tertentu supaya jenjang *precedence* tetap dituruti. Contohnya, Anda bisa meng-*override* metode + milik -kelas Fixnum: +kelas Integer: {% highlight ruby %} -class Fixnum +class Integer # Sebenarnya Anda bisa melakukan ini, # tetapi tolong jangan lakukan ini def +(other) diff --git a/it/documentation/ruby-from-other-languages/index.md b/it/documentation/ruby-from-other-languages/index.md index 6bb323b9df..a215f6a6c4 100644 --- a/it/documentation/ruby-from-other-languages/index.md +++ b/it/documentation/ruby-from-other-languages/index.md @@ -281,12 +281,12 @@ t1 == t2 In Ruby, tutte le classi sono “aperte”. Questo vuol dire che puoi aggiungere metodi e variabili e cambiarle in qualsiasi momento, e questo vale anche per -classi interne, come `Fixnum` o anche `Object`, il “genitore” di tutti gli +classi interne, come `Integer` o anche `Object`, il “genitore” di tutti gli oggetti. Ruby on Rails, per esempio, definisce una serie di metodi per fare -operazioni temporali con oggetti `Fixnum`\: +operazioni temporali con oggetti `Integer`\: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # numero di secondi in un'ora end @@ -410,10 +410,10 @@ method(:puts).call "puts è un oggetto!" Molti degli operatori sono solamente dello “zucchero sintattico” (con alcune regole di precendenza però) per delle chiamate a dei metodi. È -possibile, per esempio, ridefinire il metodo ”+” della classe Fixnum: +possibile, per esempio, ridefinire il metodo ”+” della classe Integer: {% highlight ruby %} -class Fixnum +class Integer # Puoi farlo, ma è meglio di no! def +(other) self - other diff --git a/ja/documentation/ruby-from-other-languages/index.md b/ja/documentation/ruby-from-other-languages/index.md index e3901341f9..da3b8b1d3c 100644 --- a/ja/documentation/ruby-from-other-languages/index.md +++ b/ja/documentation/ruby-from-other-languages/index.md @@ -283,12 +283,12 @@ t1 == t2 Rubyのクラスは開いています。 いつでもクラスを開いて、定義を足したり、変更することができます。 -`Fixnum`や、すべてのオブジェクトの祖先である`Object`のようなクラスであっても、 +`Integer`や、すべてのオブジェクトの祖先である`Object`のようなクラスであっても、 自由に再定義することが可能です。Ruby on Railsは、次のような -`Fixnum`に時間を扱うメソッド群を定義しています。 +`Integer`に時間を扱うメソッド群を定義しています。 {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # 1時間あたりの秒数を返します end @@ -406,10 +406,10 @@ method(:puts).call "putsはオブジェクト!" Rubyにおけるほとんどの演算子は糖衣構文です。 いくつかの優先順位規則にもとづいて、メソッド呼び出しを単に書き換えているだけです。 -たとえば、Fixnumクラスの`+`メソッドを次のようにオーバーライドすることもできます。 +たとえば、Integerクラスの`+`メソッドを次のようにオーバーライドすることもできます。 {% highlight ruby %} -class Fixnum +class Integer # できるけれど、しないほうがいいでしょう def +(other) self - other diff --git a/ko/documentation/ruby-from-other-languages/index.md b/ko/documentation/ruby-from-other-languages/index.md index 9db35715fe..86532975d5 100644 --- a/ko/documentation/ruby-from-other-languages/index.md +++ b/ko/documentation/ruby-from-other-languages/index.md @@ -257,12 +257,12 @@ t1 == t2 ### 열린 클래스 루비의 클래스는 열려 있습니다. 언제든 클래스를 열어서, 추가하고, 변경할 수 -있습니다. `Fixnum`이나 심지어 모든 객체의 부모인 `Object` 같은 코어 클래스도 -예외는 아닙니다. 루비 온 레일즈에서는 시간을 제어하기 위해 `Fixnum`에 많은 +있습니다. `Integer`이나 심지어 모든 객체의 부모인 `Object` 같은 코어 클래스도 +예외는 아닙니다. 루비 온 레일즈에서는 시간을 제어하기 위해 `Integer`에 많은 메서드를 추가해서 사용합니다. 밑을 보세요. {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # 한 시간을 초로 환산한 수 end @@ -377,11 +377,11 @@ method(:puts).call "puts is an object!" ### 연산자는 신택스 슈거 루비의 대부분의 연산자는 메서드 호출의 (몇가지 우선순위 규칙을 -포함한) 신택스 슈거입니다. 예를 들어, Fixnum의 + 메서드를 오버라이드 +포함한) 신택스 슈거입니다. 예를 들어, Integer의 + 메서드를 오버라이드 할 수 있습니다. {% highlight ruby %} -class Fixnum +class Integer # 할 수는 있지만, 하지 마세요. def +(other) self - other diff --git a/pl/documentation/ruby-from-other-languages/index.md b/pl/documentation/ruby-from-other-languages/index.md index 15a38c7f35..2b3fa87704 100644 --- a/pl/documentation/ruby-from-other-languages/index.md +++ b/pl/documentation/ruby-from-other-languages/index.md @@ -266,12 +266,12 @@ t1 == t2 Klasy Rubiego są otwarte. Można je otworzyć, dodać nowe metody czy zmienić istniejące działanie w dowolnym momencie. Nawet główne klasy -takie jak `Fixnum` czy nawet `Object`, rodzic wszystkich obiektów. Ruby +takie jak `Integer` czy nawet `Object`, rodzic wszystkich obiektów. Ruby on Rails na przykład definiuje zestaw metod do operowania czasem w -klasie `Fixnum`. Poniżej: +klasie `Integer`. Poniżej: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # liczba sekund w godzinie end @@ -390,10 +390,10 @@ method(:puts).call "puts to obiekt!" ### Operatory to cukier syntaktyczny Większość operatorów w Rubim to po prostu cukier syntaktyczny dla -wywołań metod. Możesz, na przykład, nadpisać metodę + klasy Fixnum: +wywołań metod. Możesz, na przykład, nadpisać metodę + klasy Integer: {% highlight ruby %} -class Fixnum +class Integer # Możesz, ale proszę nie rób tego ! def +(other) self - other diff --git a/pt/documentation/ruby-from-other-languages/index.md b/pt/documentation/ruby-from-other-languages/index.md index c653f13a29..3d32121931 100644 --- a/pt/documentation/ruby-from-other-languages/index.md +++ b/pt/documentation/ruby-from-other-languages/index.md @@ -275,12 +275,12 @@ t1 == t2 ### As Classes são abertas As classes em Ruby são abertas. Poderá abrir, adicionar e alterá-las a -qualquer altura. Mesmo as classes do núcleo como por exemplo `Fixnum` ou +qualquer altura. Mesmo as classes do núcleo como por exemplo `Integer` ou mesmo a classe `Object`, a classe de topo. O Ruby on Rails define uma -quantidade de métodos para lidar com as horas na classe `Fixnum`. Veja: +quantidade de métodos para lidar com as horas na classe `Integer`. Veja: {% highlight ruby %} -class Fixnum +class Integer def horas self * 3600 # nu'mero de segundos numa hora end @@ -405,10 +405,10 @@ method(:puts).call "puts e' um objecto!" A maioria dos operadores em Ruby são somente açúcar sintático (com algumas regras de precedência) para chamadas a métodos. Poderá, por -exemplo, redifinir o método + da classe Fixnum: +exemplo, redifinir o método + da classe Integer: {% highlight ruby %} -class Fixnum +class Integer # Pode fazer, mas por favor não faça isto def +(outro) self - outro diff --git a/ru/documentation/ruby-from-other-languages/index.md b/ru/documentation/ruby-from-other-languages/index.md index 9fe5167c68..1eae932ddd 100644 --- a/ru/documentation/ruby-from-other-languages/index.md +++ b/ru/documentation/ruby-from-other-languages/index.md @@ -261,12 +261,12 @@ t1 == t2 ### Открытые классы Классы в Ruby "открыты". То есть, вы можете открыть их и добавить или изменить их -в любое время. Даже базовые классы, такие как `Fixnum` или `Object`, родительский -для всех объектов. Ruby on Rails определяет несколько методов на `Fixnum`, чтобы +в любое время. Даже базовые классы, такие как `Integer` или `Object`, родительский +для всех объектов. Ruby on Rails определяет несколько методов на `Integer`, чтобы работать со временем. Смотрите: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # число секунд в 1 часе end @@ -381,10 +381,10 @@ method(:puts).call "puts is an object!" Большинство операторов в Ruby - это просто синтаксический сахар (с учетом некоторых правил) для вызова методов. Например, можно переопределить `+` метод для класса -`Fixnum`: +`Integer`: {% highlight ruby %} -class Fixnum +class Integer # Так можно, но не значит, что нужно ;) def +(other) self - other diff --git a/tr/documentation/ruby-from-other-languages/index.md b/tr/documentation/ruby-from-other-languages/index.md index fca94ed868..a8fbed93d1 100644 --- a/tr/documentation/ruby-from-other-languages/index.md +++ b/tr/documentation/ruby-from-other-languages/index.md @@ -254,12 +254,12 @@ t1 == t2 ### Sınıflar Açıktır Ruby sınıfları açıktır. İstediğiniz zaman açabilir, ekleme yapabilir, -değiştirebilirsiniz. Core sınıfları bile, mesela `Fixnum` ve hatta tüm -sınıfların anası `Object` sınıfı dahil. Ruby on Rails `Fixnum` sınıfına +değiştirebilirsiniz. Core sınıfları bile, mesela `Integer` ve hatta tüm +sınıfların anası `Object` sınıfı dahil. Ruby on Rails `Integer` sınıfına zamanla ilgili bir kısım metod eklemiştir. İzleyin: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # bir saat içindeki saniye miktarı end @@ -375,10 +375,10 @@ method(:puts).call "puts is an object!" ### Operatörler de Deyimdir Ruby’deki operatörler birbirlerine belli öncelikleri olan metodlardır. -Bu yüzden isterseniz Fixnum’un + metodunu değiştirebilirsiniz: +Bu yüzden isterseniz Integer’un + metodunu değiştirebilirsiniz: {% highlight ruby %} -class Fixnum +class Integer # Yapabilirsiniz ama lütfen bunu yapmayın def +(other) self - other diff --git a/vi/documentation/ruby-from-other-languages/index.md b/vi/documentation/ruby-from-other-languages/index.md index 4fade110b6..dfa3eefe65 100644 --- a/vi/documentation/ruby-from-other-languages/index.md +++ b/vi/documentation/ruby-from-other-languages/index.md @@ -269,12 +269,12 @@ t1 == t2 ### Các lớp đều mở Các lớp trong Ruby đều mở. Bạn có thể mở, thêm vào, và thay đổi nó bất cứ lúc nào. -Thậm chí các lớp lõi, như `Fixnum` hoặc thậm chí là `Object`, lớp chính của mọi +Thậm chí các lớp lõi, như `Integer` hoặc thậm chí là `Object`, lớp chính của mọi đối tượng. Ruby on Rails định nghĩa một loạt các phương thức để xử lý thời gian -trên `Fixnum`. Xem bên dưới: +trên `Integer`. Xem bên dưới: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # số giây trong 1 giờ end @@ -390,10 +390,10 @@ method(:puts).call "puts là một đối tượng!" ### Toán tử và cú pháp Hầu hết các toán tử trong Ruby chỉ là cú pháp (với một số quy tắc ưu tiên) -để gọi phương thức. Ví dụ, bạn có thể viết lại phương thức Fixnums + +để gọi phương thức. Ví dụ, bạn có thể viết lại phương thức Integers + {% highlight ruby %} -class Fixnum +class Integer # Bạn có thể, nhưng tốt nhất là đừng sửa def +(other) self - other diff --git a/zh_cn/documentation/ruby-from-other-languages/index.md b/zh_cn/documentation/ruby-from-other-languages/index.md index 6935c97f8a..6a86ef0114 100644 --- a/zh_cn/documentation/ruby-from-other-languages/index.md +++ b/zh_cn/documentation/ruby-from-other-languages/index.md @@ -220,10 +220,10 @@ t1 == t2 ### 类是开放的 -Ruby 的类是开放的。任何时候你都可以打开它进行增加和修改。即使像 `Fixnum` 这样的核心类,甚至是所有对象的父类 `Object` 类都可以打开。Ruby on Rails 在 `Fixnum` 类里定义了一大堆方法来处理时间问题。请看: +Ruby 的类是开放的。任何时候你都可以打开它进行增加和修改。即使像 `Integer` 这样的核心类,甚至是所有对象的父类 `Object` 类都可以打开。Ruby on Rails 在 `Fixnum` 类里定义了一大堆方法来处理时间问题。请看: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # 一小时有多少秒 end @@ -317,10 +317,10 @@ method(:puts).call "puts 是一个对象!" ### 操作符是语法糖 -Ruby 中的大部分操作符仅仅是方法调用(根据一些优先级)的语法糖。例如,你可以覆盖 Fixnum 的 + 方法: +Ruby 中的大部分操作符仅仅是方法调用(根据一些优先级)的语法糖。例如,你可以覆盖 Integer 的 + 方法: {% highlight ruby %} -class Fixnum +class Integer # 请不要这么做,虽然你可以 def +(other) self - other diff --git a/zh_tw/documentation/ruby-from-other-languages/index.md b/zh_tw/documentation/ruby-from-other-languages/index.md index de1dd5a82e..ca5b6fba31 100644 --- a/zh_tw/documentation/ruby-from-other-languages/index.md +++ b/zh_tw/documentation/ruby-from-other-languages/index.md @@ -229,11 +229,11 @@ t1 == t2 ### 類別是開放的 -Ruby 的類別是開放的,你可以隨時打開它新增一點程式或是修改。即使是核心類別如 `Fixnum` 或是 -`Object`(這是所有類別的父類別) 都一樣。 Ruby on Rails 甚至定義了一堆時間方法到 `Fixnum` 去,例如: +Ruby 的類別是開放的,你可以隨時打開它新增一點程式或是修改。即使是核心類別如 `Integer` 或是 +`Object`(這是所有類別的父類別) 都一樣。 Ruby on Rails 甚至定義了一堆時間方法到 `Integer` 去,例如: {% highlight ruby %} -class Fixnum +class Integer def hours self * 3600 # 一小時有多少秒 end @@ -339,10 +339,10 @@ method(:puts).call "puts is an object!" ### 操作符只是語法包裝 大部分的 Ruby 操作符(operators)只是一種方法呼叫的語法包裝(syntactic -sugar),加上一些優先權規則。你要的話,舉例來說,我們可以覆寫掉 Fixnum 的 + 方法: +sugar),加上一些優先權規則。你要的話,舉例來說,我們可以覆寫掉 Integer 的 + 方法: {% highlight ruby %} -class Fixnum +class Integer # 可以這麼做,但請不要這麼改 def +(other) self - other From ff3217ee4e1b1900e55129fbda8d113f6aaf4ce6 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Wed, 11 Sep 2019 19:57:21 +0900 Subject: [PATCH 2/2] Update ko/documentation/ruby-from-other-languages/index.md Co-Authored-By: Chayoung You --- ko/documentation/ruby-from-other-languages/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ko/documentation/ruby-from-other-languages/index.md b/ko/documentation/ruby-from-other-languages/index.md index 86532975d5..18a9e1dcf1 100644 --- a/ko/documentation/ruby-from-other-languages/index.md +++ b/ko/documentation/ruby-from-other-languages/index.md @@ -257,7 +257,7 @@ t1 == t2 ### 열린 클래스 루비의 클래스는 열려 있습니다. 언제든 클래스를 열어서, 추가하고, 변경할 수 -있습니다. `Integer`이나 심지어 모든 객체의 부모인 `Object` 같은 코어 클래스도 +있습니다. `Integer`나 심지어 모든 객체의 부모인 `Object` 같은 코어 클래스도 예외는 아닙니다. 루비 온 레일즈에서는 시간을 제어하기 위해 `Integer`에 많은 메서드를 추가해서 사용합니다. 밑을 보세요.