Skip to content

Instantly share code, notes, and snippets.

@RhysStansfield
Last active August 29, 2015 14:17
Show Gist options
  • Save RhysStansfield/5a1a099ac39a335f0a0d to your computer and use it in GitHub Desktop.
Save RhysStansfield/5a1a099ac39a335f0a0d to your computer and use it in GitHub Desktop.
Trainification
r@rhyss-mbp:~/git_repos/trainz$ rbenv local 2.2.0
r@rhyss-mbp:~/git_repos/trainz$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
r@rhyss-mbp:~/git_repos/trainz$ ruby trainz.rb
HERE#<App::TrainStatus:0x007fbfda84e5d0>
r@rhyss-mbp:~/git_repos/trainz$ rbenv local 2.2.1
r@rhyss-mbp:~/git_repos/trainz$ ruby -v
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
r@rhyss-mbp:~/git_repos/trainz$ ruby trainz.rb
HERE#<App::TrainStatus:0x007fc00b127bb8>
class App
class TrainStatus
def initialize
print 'HERE'
end
end
class TrainFactory
def self.parse_message(msg)
App::TrainStatus.new
end
end
end
puts App::TrainFactory.parse_message('derp')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment