Class: Usps::Support::Models::Hq::Squadrons::District

Inherits:
Website show all
Defined in:
lib/usps/support/models/hq/squadrons/district.rb

Overview

District organization information

Instance Method Summary collapse

Methods inherited from Usps::Support::Models::Hq::SharedRecord

allow_hq_database_edits?, ignore_type_column_sti!

Instance Method Details

#all_squadronsObject

def name = “District ##number



43
# File 'lib/usps/support/models/hq/squadrons/district.rb', line 43

def all_squadrons = (squadrons + former_squadrons).sort_by(&:name)

#numberObject

def self.lookup(number) = where(“Name REGEXP ‘^D?0?##number$’”).first



39
# File 'lib/usps/support/models/hq/squadrons/district.rb', line 39

def number = self.Name.sub(/^D/, '').to_i