الفرق بين المراجعتين ل"Ruby/UncaughtThrowError"

من موسوعة حسوب
اذهب إلى التنقل اذهب إلى البحث
(أنشأ الصفحة ب'<noinclude>{{DISPLAYTITLE: صفحة الصنف <code>UncaughtThrowError</code> في روبي}}</noinclude> تصنيف: Ruby تصنيف: Ruby UncaughtThrowErrorي...')
 
ط (مراجعة وتدقيق.)
 
(مراجعة متوسطة واحدة بواسطة مستخدم واحد آخر غير معروضة)
سطر 1: سطر 1:
<noinclude>{{DISPLAYTITLE: صفحة الصنف <code>UncaughtThrowError</code> في روبي}}</noinclude>
+
<noinclude>{{DISPLAYTITLE:الصنف <code>UncaughtThrowError</code> في روبي}}</noinclude>
 
[[تصنيف: Ruby]]
 
[[تصنيف: Ruby]]
[[تصنيف: Ruby UncaughtThrowError]]يُطلق الاستثناء عندما يتم استدعاء <code>throw</code> مع  
+
[[تصنيف: Ruby Class]]
وسم (tag)
+
[[تصنيف: Ruby Error]]
لا يحتوي على كتلة <code>catch</code> المقابلة.
+
[[تصنيف: Ruby UncaughtThrowError]]
 +
يُطلق الاستثناء <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="ruby">UncaughtThrowError: uncaught throw "foo"‎</syntaxhighlight>
+
<syntaxhighlight lang="text">UncaughtThrowError: uncaught throw "foo"‎</syntaxhighlight>
==توابع الصنف العامة (Public Class Methods)==
+
==توابع الصنف العامة==
===[[Ruby/UncaughtThrowError/new | التابع new]]===
+
===[[Ruby/UncaughtThrowError/new |<code>new</code>]]===
فئة الوثيقة: <code>[[Ruby/UncaughtThrowError|UncaughtThrowError]]</code>
+
ينشئ كائنًا جديدًا من النوع <code>UncaughtThrowError</code>.
===[[Ruby/UncaughtThrowError/tag | التابع tag]]===
+
 
يعيد التابع <code>tag</code> كائن الوسم (tag object) الذي تم استُدعي معه.
+
== توابع النسخة العامة ==
===[[Ruby/UncaughtThrowError/to_s | التابع to_s]]===
+
 
يعيد ظظ رسالة منسقة تحتوي الوسم (tag).
+
===[[Ruby/UncaughtThrowError/tag |<code>tag</code>]]===
===[[Ruby/UncaughtThrowError/value | التابع value]]===
+
يعيد كائن الوسم (tag object) الذي استُدعي معه.
يعيد التابع <code>value</code> القيمة المعادة من الوسم الذي تم استدعي معه.
+
===[[Ruby/UncaughtThrowError/to_s |<code>to_s</code>]]===
 +
يعيد رسالة منسقة تحتوي الوسم (tag).
 +
===[[Ruby/UncaughtThrowError/value |<code>value</code>]]===
 +
يعيد القيمة المعادة من الوسم الذي استدعي معه.
 
==مصادر==
 
==مصادر==
*[http://ruby-doc.org/core-2.5.1/UncaughtThrowError.html قسم  الصنف UncaughtThrowError في توثيق روبي الرسمي.]
+
*[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

يعيد القيمة المعادة من الوسم الذي استدعي معه.

مصادر