Class: Atlasq::Command::Any
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Atlasq::Command::Base
Instance Method Details
#content ⇒ String
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/atlasq/command/any.rb', line 9 def content search_terms.map do |term| if (country = Data.country(term)) Format.country(country) elsif (country_codes = Data.countries_by_region(term)) region_name = Util::String.titleize(term) Format.countries(country_codes, title: "Region: #{region_name}") elsif (currencies = Data.countries_by_currencies(term)) Format.currencies(currencies) elsif (languages = Data.countries_by_languages(term)) Format.languages(languages) else Atlasq.failed! "Unknown search term: #{term}" end end.join("\n\n") end |