Permalink
Browse files

名前取得メソッド追加

  • Loading branch information...
1 parent a7d915a commit 6328f78d6d9e0778d368c286554f1bd8f1c234c8 @labocho committed Mar 13, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/japanese_local_goverment/base.rb
@@ -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

0 comments on commit 6328f78

Please sign in to comment.