Last active
July 17, 2016 11:39
-
-
Save mizukmb/8523f0623febdd81a8c478703a8ee8e2 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
class Nozaki | |
attr_reader :status | |
def initialize(status="嫌い") | |
@status = status | |
end | |
def 反対の | |
s = 好き? ^ true ? "好き" : "嫌い" | |
Nozaki.new(s) | |
end | |
def 反対は | |
print self.反対の.to_s | |
end | |
def inspect | |
print "<Class: #{self.class} #{self.object_id}|#{self.status}>" | |
end | |
def to_s | |
好き? == true ? "好き" : "嫌い" | |
end | |
private | |
def 好き? | |
self.status == "好き" ? true : false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage