Sha256: 02c73e86a21bdfbfbd3df0f98a20da7b81484a54b11f4b8eb3b0d6845ab92ef2

Contents?: true

Size: 582 Bytes

Versions: 5

Compression:

Stored size: 582 Bytes

Contents

module Unidom::Geo::China::Concerns::AsSuperiorRegion

  extend ActiveSupport::Concern

  included do |includer|

    def sub_regions
      if numeric_code_suffix_empty?
        prefix  = numeric_code_middle_empty? ? numeric_code_prefix : "#{numeric_code_prefix}#{numeric_code_middle}"
        regions = self.class.numeric_code_starting_with(prefix).not_numeric_coded_as(numeric_code)
        regions = regions.numeric_code_ending_with('00') if numeric_code_middle_empty?
        regions
      else
        self.class.none
      end
    end

  end

  module ClassMethods
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
unidom-geo-china-0.4.4 app/models/unidom/geo/china/concerns/as_superior_region.rb
unidom-geo-china-0.4.3 app/models/unidom/geo/china/concerns/as_superior_region.rb
unidom-geo-china-0.4.2 app/models/unidom/geo/china/concerns/as_superior_region.rb
unidom-geo-china-0.4.1 app/models/unidom/geo/china/concerns/as_superior_region.rb
unidom-geo-china-0.4 app/models/unidom/geo/china/concerns/as_superior_region.rb