Skip to content

Instantly share code, notes, and snippets.

@nerdfiles
Created December 22, 2015 00:32
Show Gist options
  • Select an option

  • Save nerdfiles/5c3e19d6432fdfadd14f to your computer and use it in GitHub Desktop.

Select an option

Save nerdfiles/5c3e19d6432fdfadd14f to your computer and use it in GitHub Desktop.
class God
existing = false
causeGod: () ->
@causeAttributes()
@causeExtension()
causeAttributes: () ->
causeExtension: () ->
class GodWithAttributes extends God
existing = true
causeAttributes: (attributesOfGod) ->
attributesOfGod
causeExtension: (modesOfGod) ->
modesOfGod
class GodWithoutExtension extends God
existing = false
causeAttributes: (attributesOfGod) ->
attributesOfGod
gods = [new GodWithAttributes, new GodWithoutExtension]
god.causeGod() for god in gods if god.existing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment