Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-25 18:50:27 +01:00
34 Zeilen
622 B
Ruby
34 Zeilen
622 B
Ruby
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
|
|
raw_flags = YAML.safe_load(File.read(File.join(Rails.root, 'plugins', 'discourse-custom-wizard', 'config', 'national_flags.yml')))
|
|
|
|
flagscollection = []
|
|
|
|
raw_flags.map do |name, code|
|
|
flagscollection << CustomWizard::Flag.new(name, name, code)
|
|
end
|
|
|
|
flagscollection
|
|
end
|
|
end
|