Skip to content

Instantly share code, notes, and snippets.

View shikhalev's full-sized avatar

Иван Шихалев shikhalev

View GitHub Profile
@shikhalev
shikhalev / deco.rb
Created August 18, 2013 01:58
Samples for «decorators»
# encoding: utf-8
class Module
def decorator name, &wrapper
define_singleton_method name do |*names, **opts|
if names.length != 0
@ignore_wrap = true
names.each do |nm|
define_method nm, &wrapper.call(instance_method(nm), **opts)
body {
position : absolute;
top : 0px;
bottom : 0px;
left : 0px;
right : 0px;
padding : 0px;
margin : 0px;
}