Sha256: 07378fd544bc13437c474c5e104f4383c98da055c159f04a0a6a2cef932a98a1

Contents?: true

Size: 444 Bytes

Versions: 9

Compression:

Stored size: 444 Bytes

Contents

# frozen_string_literal: true

require "json"

# Class comment
module RenderJson
  def render_json(languages_input)
    # "ar" || "ar_iw_pl"
    languages_input = languages_input.split("_")
    languages_input.each do |language|
      next unless @languages.key?(language.to_sym)

      File.open("config/locales/#{language}.json", "a+") do |f|
        f.write(@languages[language.to_sym].to_json)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
habluhablu-0.5.8 lib/languages/render_json.rb
habluhablu-0.5.7 lib/languages/render_json.rb
habluhablu-0.5.6 lib/languages/render_json.rb
habluhablu-0.5.5 lib/languages/render_json.rb
habluhablu-0.5.4 lib/languages/render_json.rb
habluhablu-0.5.3 lib/languages/render_json.rb
habluhablu-0.5.2 lib/languages/render_json.rb
habluhablu-0.5.1 lib/languages/render_json.rb
habluhablu-0.5.0 lib/languages/render_json.rb