Skip to content

Instantly share code, notes, and snippets.

@vinbarnes
Created August 12, 2010 21:23
Show Gist options
  • Select an option

  • Save vinbarnes/521774 to your computer and use it in GitHub Desktop.

Select an option

Save vinbarnes/521774 to your computer and use it in GitHub Desktop.
class Punch
class << self
original_load = self.instance_method(:load)
# if you want to call the original use:
# original_load.bind(self).call
define_method(:load) do |file|
raise ArgumentError, 'no filename supplied' unless file
@data = YAML.load(File.read(file))
end
end
end
@ymendel
Copy link
Copy Markdown

ymendel commented Aug 12, 2010

I'm not accepting this pull request.

@vinbarnes
Copy link
Copy Markdown
Author

why are you afraid of unbounded methods?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment