attach_function

时间:2021-06-19 02:29:53
【文件属性】:
文件名称:attach_function
文件大小:16KB
文件格式:ZIP
更新时间:2021-06-19 02:29:53
Ruby 附加功能 AttachFunction 定义了新方法,这些方法是目标函数的部分应用,其中目标函数的第一个参数固定为 self。 新定义的方法的名称将是目标函数的基本名称(模块路径被剥离)或用户指定的名称。 相对指定的参数函数的接​​收者将是当前模块,如果给出了用户指定的名称并且用户指定的名称与目标函数的基名不同,或者封闭模块,如果没有用户指定的名称提供或用户指定的名称与参数的基本名称相同。 用法示例: require 'attach_function' module Math #This will contain the method versions of the functions defined in the Math module module MethodVersions #Get the attach_function macro extend A
【文件预览】:
attach_function-master
----.gitignore(118B)
----Guardfile(2KB)
----VERSIONING.md(1KB)
----.rspec(31B)
----.travis.yml(30B)
----examples()
--------enclosing_scope.rb(368B)
----spec()
--------spec_helper.rb(139B)
--------attach_function_spec.rb(3KB)
----README.md(4KB)
----lib()
--------attach_function()
--------attach_function.rb(3KB)
----attach_function-0.1.2.gem(10KB)
----attach_function.gemspec(1KB)
----Gemfile(39B)
----Rakefile(117B)

网友评论