class BabelishRnc::CSV2Php

Attributes

php_tag[RW]

Public Class Methods

new(filename, langs, args = {}) click to toggle source
Calls superclass method BabelishRnc::Csv2Base::new
# File lib/babelish_rnc/csv2php.rb, line 5
def initialize(filename, langs, args = {})
  super(filename, langs, args)
  # TODO: list this arg in commandline
  @php_tag = args[:php_tag].nil? ? 'lang' : args[:php_tag]
end

Public Instance Methods

extension() click to toggle source
# File lib/babelish_rnc/csv2php.rb, line 21
def extension
  "php"
end
get_row_format(row_key, row_value, comment = nil, indentation = 0, defaultlang = "") click to toggle source
# File lib/babelish_rnc/csv2php.rb, line 17
def get_row_format(row_key, row_value, comment = nil, indentation = 0, defaultlang = "")
  "$" + @php_tag + "['#{row_key}']" + " " * indentation + " = \"#{row_value}\";\n"
end
language_filepaths(language) click to toggle source
# File lib/babelish_rnc/csv2php.rb, line 11
def language_filepaths(language)
  require 'pathname'
  filepath = Pathname.new(@output_dir) + "#{language.code}" + "lang.php"
  return filepath ? [filepath] : []
end