In [ ]:
defmodule Me do
defstruct about: %{
name: "松尾和昭",
job: "Test Engineer",
at: "Cookpad Inc.",
sns: %{
twitter: "@Kazu_cocoa",
github: "KazuCocoa",
blog: "kazucocoa.wordpress.com"
}
}
def topic(order) do
case order do
"first" ->
~s(最近のAndroid/iOSの周辺)
"second" ->
~s(モバイルアプリを取りまくテスト環境とその変化)
"last" ->
~s(事例)
_ ->
~s(order should be first/second/last)
end
end
end
In [ ]:
me = %Me{}.about
In [ ]:
me.name
In [ ]:
me.job
In [ ]:
me.at
In [ ]:
me.sns.twitter
In [ ]:
me.sns.github
In [ ]:
me.sns.blog
In [ ]:
Me.topic
In [ ]:
Me.topic("first")
In [ ]:
Me.topic("second")
In [ ]:
Me.topic("last")
In [ ]: