Class: Manacle::Proxy::Template
- Inherits:
-
Object
- Object
- Manacle::Proxy::Template
- Defined in:
- lib/manacle/proxy/template.rb,
lib/manacle/proxy/template/factory.rb
Defined Under Namespace
Classes: Factory
Class Method Summary collapse
Class Method Details
.cut(klass) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/manacle/proxy/template.rb', line 10 def self.cut(klass) Class.new do |k| include Manacle::Proxy::InstanceMethods define_method(:proxied_klass) do klass end private :proxied_klass methods = klass.instance_methods.reject {|m| [:inspect, :new, :class].include?(m) }.map {|m| Method::Constrained.new(m) } + Manacle::Constraint::InstanceMethods.instance_methods.map {|m| Method::Unconstrained.new(m) } methods.each do |mth| mth.bind(self) end end end |