Created
April 22, 2013 23:10
-
-
Save barn/5439379 to your computer and use it in GitHub Desktop.
Why this happen?
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'ap' | |
class Updates | |
attr_reader :parsed, :raw | |
def initialize( ) | |
unless Updates.has_output? | |
Updates::get_output | |
puts 'pop' | |
ap @parsed | |
end | |
@parsed | |
end | |
def self.has_output? | |
return ! @parsed.nil? | |
end | |
def self.get_output | |
@parsed = 'cake' | |
end | |
end | |
foo = Updates.new | |
ap foo |
This file contains hidden or 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
[kali:~]% ruby foo.rb | |
pop | |
nil | |
#<Updates:0x007fd911039188> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment