class Babelish::CSV2Php
Attributes
php_tag[RW]
Public Class Methods
new(filename, langs, args = {})
click to toggle source
Calls superclass method
Babelish::Csv2Base::new
# File lib/babelish/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/csv2php.rb, line 21 def extension "php" end
get_row_format(row_key, row_value, comment = nil, indentation = 0)
click to toggle source
# File lib/babelish/csv2php.rb, line 17 def get_row_format(row_key, row_value, comment = nil, indentation = 0) "$" + @php_tag + "['#{row_key}']" + " " * indentation + " = \"#{row_value}\";\n" end
language_filepaths(language)
click to toggle source
# File lib/babelish/csv2php.rb, line 11 def language_filepaths(language) require 'pathname' filepath = Pathname.new(@output_dir) + "#{language.code}" + "lang.php" return filepath ? [filepath] : [] end