class Eman::Formatter
Public Class Methods
new(generator)
click to toggle source
# File lib/eman/formatter.rb, line 6 def initialize(generator) @generator = generator end
Public Instance Methods
camel_case!()
click to toggle source
# File lib/eman/formatter.rb, line 10 def camel_case! if is_model_name? "#{inputs_camelized}" else "#{inputs_camelized}#{type.capitalize}" end end
snake_case!()
click to toggle source
# File lib/eman/formatter.rb, line 18 def snake_case! if is_model_name? "#{inputs_snakified}" else "#{inputs_snakified}_#{type.downcase}" end end
Private Instance Methods
inputs()
click to toggle source
# File lib/eman/formatter.rb, line 28 def inputs @generator.inputs end
inputs_camelized()
click to toggle source
# File lib/eman/formatter.rb, line 36 def inputs_camelized inputs.collect(&:capitalize).join end
inputs_snakified()
click to toggle source
# File lib/eman/formatter.rb, line 40 def inputs_snakified inputs.collect(&:downcase).join('_') end
is_model_name?()
click to toggle source
# File lib/eman/formatter.rb, line 44 def is_model_name? type == 'Model' end
type()
click to toggle source
# File lib/eman/formatter.rb, line 32 def type @generator.type end