Created
March 15, 2009 03:40
-
-
Save atmos/79295 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
require 'rubygems' | |
gem 'xml-mapping' | |
require 'xml/mapping' | |
class Foo | |
include XML::Mapping | |
def self.file_data | |
@file_data ||= nil | |
end | |
def self.file_data=(value) | |
@file_data = value | |
end | |
def initialize(file) | |
if self.class.file_data.nil? | |
puts "LOADING!!!" | |
self.class.file_data = self.class.load_from_file(file) | |
end | |
end | |
end | |
Foo.new("/Users/atmos/.samurai/git/xc88/cluster.xml") | |
Foo.new("/Users/atmos/.samurai/git/xc88/cluster.xml") | |
Foo.new("/Users/atmos/.samurai/git/xc88/cluster.xml") |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment