Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def self.cross_platform_method(name)
- metaclass.instance_eval do
- define_method(name) do |*args|
- begin
- self.send("#{name}_#{os.downcase}", *args)
- rescue NoMethodError
- raise NotImplementedError.new("#{name} is not yet supported on this platform.")
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment