Skip to content

Instantly share code, notes, and snippets.

@lolgear
Last active August 29, 2015 14:05
Show Gist options
  • Save lolgear/15bc4f49c28278ef4e20 to your computer and use it in GitHub Desktop.
Save lolgear/15bc4f49c28278ef4e20 to your computer and use it in GitHub Desktop.
attr_accessor(
:path,
:name
)
def initialize(path,name)
self.path = path
if name
@name = name
end
end
def path=(path)
if self.looks_like_name(File.basename(path))
@name = File.basename(path)
end
@path = path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment