Sha256: b67dcb76a1d5173d392ffdc98b67969519c02a6df003e5bfac5c9fd7eb16d1e5

Contents?: true

Size: 734 Bytes

Versions: 5

Compression:

Stored size: 734 Bytes

Contents

module Xcmultilingual
  Bundle = Struct.new("Bundle", :relative_path, :name, :tables) do
    def description
      name_description = name.nil? ? "MAIN BUNDLE" : name
      relative_path_description = relative_path.nil? ? "NO RELATIVE PATH" : relative_path
      tables_description = tables.map { |table| table.description }.join(" / ")
      "[#{name_description}]\nname: #{name_description}, relative_path: #{relative_path_description}, tables: #{tables_description}"
    end
  end

  Table = Struct.new("Table", :name, :keys) do
    def description
      keys_description = keys.join(", ")
      "[Table] name: #{name}, keys: #{keys_description}"
    end
  end
end

class String
  def safe
    return self.gsub(" ", "_")
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
xcmultilingual-0.3.0 lib/xcmultilingual/bundle.rb
xcmultilingual-0.2.3 lib/xcmultilingual/bundle.rb
xcmultilingual-0.2.2 lib/xcmultilingual/bundle.rb
xcmultilingual-0.2.1 lib/xcmultilingual/bundle.rb
xcmultilingual-0.2.0 lib/xcmultilingual/bundle.rb