Skip to content

Instantly share code, notes, and snippets.

@Paxa
Created February 25, 2011 12:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Paxa/843739 to your computer and use it in GitHub Desktop.
Save Paxa/843739 to your computer and use it in GitHub Desktop.
class Report
class << self
attr_accessor :current
def store(string)
@current ||= new
@current.store(string)
end
end
attr_accessor :strings
def initialize
@strings = []
end
def store(string)
@strings << string
end
def deliver
p ["Delivering ...", @strings]
self.class.current = nil
self
end
end
Report.store("sdadasda")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment