Class: Basho::DB::Prefecture
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Basho::DB::Prefecture
- Defined in:
- lib/basho/db/prefecture.rb
Overview
都道府県のActiveRecordモデル(+basho_prefectures+ テーブル)。 メモリ版 Prefecture と同じAPI(+type+, +region+, +capital+)を提供する。
Instance Method Summary collapse
-
#capital ⇒ DB::City?
県庁所在地.
- #region ⇒ Region
-
#type ⇒ String
種別("都" / "道" / "府" / "県").
Instance Method Details
#capital ⇒ DB::City?
Returns 県庁所在地.
23 |
# File 'lib/basho/db/prefecture.rb', line 23 def capital = capital_code && Basho::DB::City.find_by(code: capital_code) |
#region ⇒ Region
20 |
# File 'lib/basho/db/prefecture.rb', line 20 def region = Region.find(region_name) |
#type ⇒ String
Returns 種別("都" / "道" / "府" / "県").
17 |
# File 'lib/basho/db/prefecture.rb', line 17 def type = prefecture_type |