Class: RailsAppGenerator::MapOptionString

Inherits:
BaseMapOption show all
Defined in:
lib/rails_app_generator/options/map_option_string.rb

Overview

Simple pass through mapper for options that do not yet have a mapper defined

Instance Method Summary collapse

Methods inherited from BaseMapOption

#option_name

Instance Method Details

#map(name, value) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/rails_app_generator/options/map_option_string.rb', line 6

def map(name, value)
  return '' if value.nil? || value.empty?

  value = value.to_s
  value = "\"#{value}\"" if value.include?(' ')
  "#{option_name(name)}=#{value}"
end