Module: CountryStateSelect

Includes:
Constant
Defined in:
lib/country_state_select/engine.rb,
lib/country_state_select.rb,
lib/country_state_select/engine3.rb,
lib/country_state_select/railtie.rb,
lib/country_state_select/version.rb,
lib/country_state_select/constant.rb

Overview

Author:

  • Arvind Vyas

Defined Under Namespace

Modules: Constant, Rails

Constant Summary collapse

VERSION =
"1.0.1"

Constants included from Constant

Constant::CANADIAN_STATES, Constant::COUNTRIES, Constant::INDIAN_STATES, Constant::INDIAN_TERRIOTORY, Constant::UK_STATES, Constant::USA_STATES

Class Method Summary collapse

Class Method Details

.all_statesObject



28
29
30
# File 'lib/country_state_select.rb', line 28

def self.all_states
  INDIAN_STATES.merge(INDIAN_TERRIOTORY).merge(USA_STATE_LIST).merge(CANADIAN_STATES).merge(UK_STATES)
end

.canadian_statesObject



20
21
22
# File 'lib/country_state_select.rb', line 20

def self.canadian_states
  CANADIAN_STATES
end

.countriesObject



8
9
10
# File 'lib/country_state_select.rb', line 8

def self.countries
  COUNTRIES
end

.countries_except(*except) ⇒ Object

this method will provide the user to opetion to skip any countries in drop down list



33
34
35
36
37
38
39
# File 'lib/country_state_select.rb', line 33

def self.countries_except(*except)
  countries = []
  COUNTRIES.each do |country|
    countries<< country unless  country.in?(except)
  end
  return countries
end

.indiaObject



12
13
14
# File 'lib/country_state_select.rb', line 12

def self.india
  INDIAN_STATES.merge(INDIAN_TERRIOTORY)
end

.uk_statesObject



24
25
26
# File 'lib/country_state_select.rb', line 24

def self.uk_states 
  UK_STATES
end

.us_statesObject



16
17
18
# File 'lib/country_state_select.rb', line 16

def self.us_states
  USA_STATE_LIST
end