Last active
August 29, 2015 14:24
-
-
Save krainboltgreene/09fe0b0dd1d1704e69a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entity = Node.new(id: id) | |
case | |
when not enity.exists? then fail("Entity doesn't exist") | |
when not entity.file? then fail("Entity wasn't a file") | |
when not entity.writable? then fail("Entity wasn't writable") | |
else entity.write(data) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entity = Node.new(id: id) | |
if enity.exists? && entity.file? && entity.writable? | |
entity.write(data) | |
else | |
fail("Entity doesn't exist") unless enity.exists? | |
fail("Entity wasn't a file") unless entity.file? | |
fail("Entity wasn't writable") unless entity.writable? | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entity = Node.new(id: id) | |
fail("Entity doesn't exist") unless enity.exists? | |
fail("Entity wasn't a file") unless entity.file? | |
fail("Entity wasn't writable") unless entity.writable? | |
entity.write(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment