Created
December 6, 2011 04:42
-
-
Save smellman/1436777 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
# coding: utf-8 | |
class Cパンツ | |
def initialize(好み = {}) | |
@色 = 好み[:色] || 0xFFFFFF | |
@柄 = 好み[:柄] || :無地 | |
end | |
def 何色? | |
sprintf("%#x", @色) | |
end | |
def 何柄? | |
@柄.to_s | |
end | |
end | |
パンツ = Cパンツ | |
class Cノーパン < Cパンツ | |
def 何色? | |
"パンツ履いてない" | |
end | |
def 何柄? | |
"パンツ履いてない" | |
end | |
end | |
ノーパン = Cノーパン | |
class Cお姉ちゃん | |
attr_reader :パンツ | |
def initialize(好み = {}) | |
if 好み[:履いてない] | |
@パンツ = Cノーパン.new | |
else | |
@パンツ = 好み[:パンツ] || Cパンツ.new(:色 => 0xFFFFFF, | |
:柄 => :無地) | |
end | |
end | |
end | |
お姉ちゃん = Cお姉ちゃん | |
alias ぐへへ puts | |
def 履いてない | |
return true | |
end | |
ほむらちゃん = お姉ちゃん.new | |
まどかちゃん = お姉ちゃん.new(:パンツ => パンツ.new(:色 => 0x11BFF1, | |
:柄 => :しましま)) | |
ぐへへ ほむらちゃん.パンツ.何色? | |
ぐへへ ほむらちゃん.パンツ.何柄? | |
ぐへへ まどかちゃん.パンツ.何色? | |
ぐへへ まどかちゃん.パンツ.何柄? | |
まみさん = お姉ちゃん.new(:履いてない => 履いてない) | |
ぐへへ まみさん.パンツ.何色? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment