2019-09-11 10:30:38 +02:00
|
|
|
class CustomWizard::Flag
|
|
|
|
def initialize(id, name, value)
|
|
|
|
@id = id
|
|
|
|
@name = name
|
|
|
|
@value = value
|
|
|
|
end
|
|
|
|
|
|
|
|
def id
|
|
|
|
@id
|
|
|
|
end
|
|
|
|
|
|
|
|
def name
|
|
|
|
@name
|
|
|
|
end
|
|
|
|
|
|
|
|
def value
|
|
|
|
@value
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class CustomWizard::Flags
|
|
|
|
|
|
|
|
def self.list
|
2019-10-04 23:13:41 +02:00
|
|
|
raw_flags = YAML.safe_load(File.read(File.join(Rails.root, 'plugins', 'discourse-custom-wizard', 'config', 'national_flags.yml')))
|
2019-09-11 10:30:38 +02:00
|
|
|
|
|
|
|
flagscollection = []
|
|
|
|
|
2019-10-04 23:13:41 +02:00
|
|
|
raw_flags.map do |name, code|
|
|
|
|
flagscollection << CustomWizard::Flag.new(name, name, code)
|
2019-09-11 10:30:38 +02:00
|
|
|
end
|
|
|
|
|
2019-10-04 23:13:41 +02:00
|
|
|
flagscollection
|
2019-09-11 10:30:38 +02:00
|
|
|
end
|
|
|
|
end
|