Giter VIP home page Giter VIP logo

define_method_handler's Introduction

................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
........................,DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM..................
..................~MMMMMMM8:........+NMMZ:....$MZ............NMM................
...............MMM~.......................,........,M..........MM+..............
............NMM:..,~..=8MM87?7OMMMMD............+MZ...O7........MMO.............
..........MMM...............................,?DMM,...M...M.......MM?............
.........,M,.......M.........8......................+8.~O..7......MM............
.........NM.................M..........$...............M...........MM...........
.........MM..................O.........,......78D7......O..:.......+M:..........
........MM...................O...........MMMM$MMMMMMMM?.............OMD.........
......IMM.........NMMMMMMMMM,..........MM?....MMMMMM$.MM.............,MM........
.....MM7.NM?......8MMMMMMMMMMM,MM.....MM...MMMMMMNNMMMMMM.:M,........N~=MM......
....MM.8..,.................MMM$.......MMMM.....NM..........ZMMMMMMO....+.MN....
...8M87.D...MMM=.............M...................MMM.....,MMMM.....NMD.....MM...
...MM.,.M.MMN..+MMM.OM.......M.....................?MMMMMM+....M.....MM..M.:M...
...ZM...M.....M..MMMM......MMM...............................DMMM.....M..D..MM..
....M==.M.....M..........MM8...........MMMMMM............,MMMN..MMM,..M,.M..MM..
....NMM...$..MMI.......MMMM..........,....MM..........DMMMM....MM?OM$NM..+..MZ..
.....MM.8M..MMMM....D:..O.MM......+MMMMM.8MN......MMMMMM......8MM....M.....MM...
......MM....MMMMMM,.........MM+M~............NMMMM8....M?...NMMM?......?..MM....
.......MD...MMM,MMMMMM.......,M.......=MMMMMM,........MMMMMMMMM.........MMM.....
.......MM...MMM.MM..NMMMMMMMMMMMMMMMMMMM,...MM......MMMMMD..MM........7MM.......
.......DM...MMM.MM..MM......MN....+M........MM.MMMMMMMNM...MM........IMM........
.......:M...MMMMMMM.MM......M.....+M......DMMMMMMMM...DM..MM.........MN.........
........M...MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM........MMMN.........MM..........
.......,M...MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM~..MM.......8MM,.........:M...........
.......$M...ZM.MMMMMMMMMMMMMMMMMMMMMMO.......~MZ....MMMO..........=M8...........
.......MM....MM:M.$M...M....MM......MN........NM.~MMM,...........MM,............
.......MM.....MM7..MM..MM....M......MM........MMMMD.....Z...O..MMM..............
.......M7......8MMMMMMO,MM...MM.....MM87NMMMMMM,....M=..=M?..MMM................
.......M...........IMMMMMMMMMMMMMMMMMMMMMMZ......M$...MD...MMM..................
......:M...I...:.............................,M...MM...,MMM.....................
......ZM...+.....M:......................IM,..MN....OMMM........................
......NM....=.........?7$I?~::,.........?M?......MMMM...........................
......DM......=MO................+MO..........MMMN..............................
.......MN..................................MMM?.................................
........MM..........................MMMMMMM~....................................
.........MMM...................NMMMMMMM,........................................
...........NMMMMMNO7I$DMMMMMMMMD................................................
................+DMMMNZ~........................................................
................................................................................
................................................................................
................................................................................

define_method_handler's People

Contributors

tario avatar

Stargazers

 avatar

Watchers

 avatar

define_method_handler's Issues

Anonymous, of easy creation and inherited chains

class X
define_method_handler(:foo) { |a|
a == 4 ? 3 : ignore
}
end

chain = define_chain(X).handler(:foo){|a|
if a == 3
a+1
else
ignore
end
}.handler(:foo){|a|
chain.foo(a-1)
}.new

define_chain should return an anonymous class

Nested groups, method handlers with multiple groups

class Chain
handler_scope(:group => :a) do
handler_scope(:group => :b) do
define_method_handler(:foo) do
99
end
end
end
end

chain = Chain.new
chain.disable_handler_group(:a) do
chain.foo # nil
end

chain.disable_handler_group(:b) do
chain.foo # nil
end

chain.disable_handler_group(:default) do
chain.foo # nil
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.