Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class VersionBlock
- attr_accessor :version_major,
- :version_minor,
- :revision_num,
- :author_info,
- :website_loc
- def initialize parent
- @parent = parent
- end
- end
- class AddIn
- def initialize name, *version, &block
- if block_given?
- @parent = eval "self", block.binding
- @VersionInfo = VersionBlock.new @parent
- instance_eval &block
- puts version_block.version_major
- end
- end
- private
- def version_block
- VersionBlock.new self
- end
- end
- AddIn.new "Microsoft OLE helper for Windows", :X, :Y do
- def proc
- puts "Hi, there!"
- end
- version_block do
- version_major 1
- version_minor 0
- revision_num 0
- author_info "", ""
- website ""
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement