الفرق بين المراجعتين ل"Ruby/UncaughtThrowError"
< Ruby
اذهب إلى التنقل
اذهب إلى البحث
جميل-بيلوني (نقاش | مساهمات) ط (مراجعة وتدقيق.) |
|||
سطر 1: | سطر 1: | ||
− | <noinclude>{{DISPLAYTITLE: | + | <noinclude>{{DISPLAYTITLE:الصنف <code>UncaughtThrowError</code> في روبي}}</noinclude> |
[[تصنيف: Ruby]] | [[تصنيف: Ruby]] | ||
+ | [[تصنيف: Ruby Class]] | ||
+ | [[تصنيف: Ruby Error]] | ||
[[تصنيف: Ruby UncaughtThrowError]] | [[تصنيف: Ruby UncaughtThrowError]] | ||
− | يُطلق الاستثناء <code>UncaughtThrowError</code> عندما يتم استدعاء <code>throw</code> مع وسم (tag) لا يحتوي على | + | يُطلق الاستثناء <code>UncaughtThrowError</code> عندما يتم استدعاء <code>throw</code> مع وسم (tag) لا يحتوي على الكتلة <code>catch</code> المقابلة. |
<syntaxhighlight lang="ruby">throw "foo", "bar"</syntaxhighlight> | <syntaxhighlight lang="ruby">throw "foo", "bar"</syntaxhighlight> | ||
− | يطلق | + | عند تنفيذ هذا السطر من الشيفرة، يطلق استثناء بالشكل: |
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="text">UncaughtThrowError: uncaught throw "foo"</syntaxhighlight> |
− | ==توابع الصنف العامة | + | ==توابع الصنف العامة== |
− | ===[[Ruby/UncaughtThrowError/new | | + | ===[[Ruby/UncaughtThrowError/new |<code>new</code>]]=== |
− | + | ينشئ كائنًا جديدًا من النوع <code>UncaughtThrowError</code>. | |
− | == توابع النسخة العامة | + | == توابع النسخة العامة == |
− | ===[[Ruby/UncaughtThrowError/tag | | + | ===[[Ruby/UncaughtThrowError/tag |<code>tag</code>]]=== |
− | يعيد | + | يعيد كائن الوسم (tag object) الذي استُدعي معه. |
− | ===[[Ruby/UncaughtThrowError/to_s | | + | ===[[Ruby/UncaughtThrowError/to_s |<code>to_s</code>]]=== |
يعيد رسالة منسقة تحتوي الوسم (tag). | يعيد رسالة منسقة تحتوي الوسم (tag). | ||
− | ===[[Ruby/UncaughtThrowError/value | | + | ===[[Ruby/UncaughtThrowError/value |<code>value</code>]]=== |
− | يعيد | + | يعيد القيمة المعادة من الوسم الذي استدعي معه. |
==مصادر== | ==مصادر== | ||
− | *[http://ruby-doc.org/core-2.5.1/UncaughtThrowError.html | + | *[http://ruby-doc.org/core-2.5.1/UncaughtThrowError.html صفحة الصنف UncaughtThrowError في توثيق روبي الرسمي.] |
المراجعة الحالية بتاريخ 07:45، 8 ديسمبر 2018
يُطلق الاستثناء UncaughtThrowError
عندما يتم استدعاء throw
مع وسم (tag) لا يحتوي على الكتلة catch
المقابلة.
throw "foo", "bar"
عند تنفيذ هذا السطر من الشيفرة، يطلق استثناء بالشكل:
UncaughtThrowError: uncaught throw "foo"
توابع الصنف العامة
new
ينشئ كائنًا جديدًا من النوع UncaughtThrowError
.
توابع النسخة العامة
tag
يعيد كائن الوسم (tag object) الذي استُدعي معه.
to_s
يعيد رسالة منسقة تحتوي الوسم (tag).
value
يعيد القيمة المعادة من الوسم الذي استدعي معه.