paramix:参数混合

时间:2021-06-15 08:44:32
【文件属性】:
文件名称:paramix:参数混合
文件大小:29KB
文件格式:ZIP
更新时间:2021-06-15 08:44:32
Ruby 百合 · ·· 关于 参数化 Mixins 提供了一种简单的方法来“功能化”模块。 然后可以根据提供的参数在使用时区分模块。 用法 这是最基本的例子。 它只是使参数模块的参数在实例级别可用。 module M include Paramix::Parametric paramaterized do |params| define_method :params do params end end def hello "Hello, %s!" % [params[:name]] end end class X include M[:name=>'Charlie'] end X.new.hello #=> 'Hello, Charlie!' 因为 +parameterized+ 方法定义了一个在新 Parametric::Mi
【文件预览】:
paramix-master
----.travis.yml(96B)
----.index(1KB)
----HISTORY.md(2KB)
----MANIFEST(329B)
----var()
--------name(8B)
--------description(57B)
--------title(8B)
--------repositories(53B)
--------resources(282B)
--------authors(34B)
--------organizations(16B)
--------requirements(76B)
--------created(11B)
--------copyrights(40B)
--------summary(18B)
--------version(6B)
----.yardopts(38B)
----Assembly(616B)
----work()
--------newidea()
--------public.rb(778B)
--------announce.txt(344B)
--------oldschool()
--------deprecated()
----Gemfile(38B)
----.gitignore(48B)
----lib()
--------paramix()
--------paramix.rb(2KB)
----demo()
--------07_namespaces.md(475B)
--------06_extend.md(418B)
--------01_basic.md(2KB)
--------03_battery.md(464B)
--------08_dynamic.md(581B)
--------02_general.md(1KB)
--------09_nested.md(3KB)
--------05_include.md(436B)
--------applique()
----.gemspec(4KB)
----README.md(2KB)
----LICENSE.txt(1KB)

网友评论