Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AddIn
- def initialize name, *version, &block
- @outside = self
- if block_given?
- if block.arity==1
- yield self
- else
- instance_eval &block
- end
- end
- @version = block.call :VersionInfo
- puts @version.inspect
- puts block.inspect
- end
- def method_missing
- # ...
- end
- private
- @outside = nil
- end
- AddIn.new "api.xyzzy.helper".to_s, :X, :Y do
- def VersionInfo
- []
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement