Created
December 6, 2011 04:39
-
-
Save kkosuge/1436770 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お姉ちゃん | |
attr_reader :パンツ | |
def initialize(好み = {}) | |
@パンツ = 好み[:パンツ] || Cパンツ.new(:色 => 0xFFFFFF, | |
:柄 => :無地) | |
end | |
end | |
お姉ちゃん = Cお姉ちゃん | |
alias ぐへへ puts | |
ほむらちゃん = お姉ちゃん.new | |
まどかちゃん = お姉ちゃん.new(:パンツ => パンツ.new(:色 => 0x11BFF1, | |
:柄 => :しましま)) | |
ぐへへ ほむらちゃん.パンツ.何色? | |
ぐへへ ほむらちゃん.パンツ.何柄? | |
ぐへへ まどかちゃん.パンツ.何色? | |
ぐへへ まどかちゃん.パンツ.何柄? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment