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

من موسوعة حسوب
< Ruby‏ | Binding
اذهب إلى التنقل اذهب إلى البحث
ط (نقل محمد-بغات صفحة Binding/receiver إلى Ruby/Binding/receiver)
ط (مراجعة وتدقيق.)
 
سطر 1: سطر 1:
<noinclude>{{DISPLAYTITLE: <code>التابعBinding.receiver</code> في روبي}}</noinclude>
+
<noinclude>{{DISPLAYTITLE: التابع <code>Binding.receiver</code> في روبي}}</noinclude>
 
[[تصنيف: Ruby]]
 
[[تصنيف: Ruby]]
 
[[تصنيف: Ruby Method]]
 
[[تصنيف: Ruby Method]]
[[تصنيف: Ruby ARGF]]
+
[[تصنيف: Ruby Binding]]
 
يعيد التابع <code>receiver</code> المستقبِل المرتبط (bound receiver) لكائن الربط (binding object).
 
يعيد التابع <code>receiver</code> المستقبِل المرتبط (bound receiver) لكائن الربط (binding object).
 
==البنية العامة==
 
==البنية العامة==
سطر 25: سطر 25:
 
  </syntaxhighlight>
 
  </syntaxhighlight>
 
==انظر أيضًا==
 
==انظر أيضًا==
* التابع [[Ruby/Binding/eval | <code>eval</code>]]: يقدر تعابير لغة روبي الممررة إليه في السياق <code>binding</code>.
+
* التابع<nowiki/>[[Ruby/Binding/eval | <code>eval</code>]]: يقدر تعابير لغة روبي الممررة إليه في السياق <code>[[Ruby/Binding|Binding]]</code>.
* التابع [[Ruby/Binding/local_variables | <code>local_variables</code>]]: يعيد أسماء المتغيرات المحلية المعرفة في <code>Binding</code> على شكل رموز (<code>symbols</code>).
+
* التابع<nowiki/>[[Ruby/Binding/local_variables | <code>local_variables</code>]]: يعيد أسماء المتغيرات المحلية المعرفة في <code>[[Ruby/Binding|Binding]]</code> على شكل رموز (symbols).
* التابع [[Ruby/Binding/local_variable_set | <code>local_variable_set</code>]]‎: يضبط قيمة المتغير المحلي الممرر إليه إلى قيمة معينة.
+
* التابع<nowiki/>[[Ruby/Binding/local_variable_set | <code>local_variable_set</code>]]‎: يضبط قيمة المتغير المحلي الممرر إليه إلى قيمة معينة.
* التابع [[Ruby/Binding/local_variable_get |<code>local_variable_get</code>]] ‎: يعيد قيمة المتغير المحلي الممرَّر إليه.
+
* التابع<nowiki/>[[Ruby/Binding/local_variable_get |<code>local_variable_get</code>]] ‎: يعيد قيمة المتغير المحلي الممرَّر إليه.
 
==مصادر==
 
==مصادر==
 
* [http://ruby-doc.org/core-2.5.1/Binding.html#method-i-receiver قسم التابع receiver في الصنف Binding في توثيق روبي الرسمي.]
 
* [http://ruby-doc.org/core-2.5.1/Binding.html#method-i-receiver قسم التابع receiver في الصنف Binding في توثيق روبي الرسمي.]

المراجعة الحالية بتاريخ 08:27، 4 أكتوبر 2018

يعيد التابع receiver المستقبِل المرتبط (bound receiver) لكائن الربط (binding object).

البنية العامة

 receiver  object

القيم المعادة

يعاد كائن يمثل المستقبِل المرتبط (bound receiver) لكائن الربط المعطى.

أمثلة

مثال على استخدام التابع receiver:

 
def initialize
   @a = 1
 end
 
 def get_binding
   binding
 end
end

b = BindingTest.new.get_binding
b.receiver     # =>   #<BindingTest:0x007ff5fa285c10 @a=1>

انظر أيضًا

  • التابع eval: يقدر تعابير لغة روبي الممررة إليه في السياق Binding.
  • التابع local_variables: يعيد أسماء المتغيرات المحلية المعرفة في Binding على شكل رموز (symbols).
  • التابع local_variable_set‎: يضبط قيمة المتغير المحلي الممرر إليه إلى قيمة معينة.
  • التابعlocal_variable_get ‎: يعيد قيمة المتغير المحلي الممرَّر إليه.

مصادر