Skip to content

Instantly share code, notes, and snippets.

@rodrigopinto
Created June 14, 2012 14:34
Show Gist options
  • Save rodrigopinto/2930723 to your computer and use it in GitHub Desktop.
Save rodrigopinto/2930723 to your computer and use it in GitHub Desktop.
Ideia cru de como implementar os parses independente de ORM
class ToolParser
def to_json
self.to_json
end
def to_hash # or attributes
self.to_hash
end
def execute(xml)
raise NotImplementedError # do the hard work here
end
end
class NessusParser < ToolParser
def execute(xml)
# do the hard work here and few other places :)
end
end
class NmapParser < ToolParser
def execute(xml)
# do the hard work here and few other places :)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment