Skip to content

Commit

Permalink
名前取得メソッド追加
Browse files Browse the repository at this point in the history
  • Loading branch information
labocho committed Mar 13, 2012
1 parent a7d915a commit 6328f78
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/japanese_local_goverment/base.rb
Expand Up @@ -28,6 +28,14 @@ def code=(value)
self[:code] = value ? value[0..4] : value
end

def name
ward || city || pref
end

def full_name
"#{pref}#{city}#{ward}"
end

def prefecture?
is_a? Prefecture
end
Expand Down

0 comments on commit 6328f78

Please sign in to comment.