class Ember::Generators::ModelGenerator

Constants

EMBER_TYPE_LOOKUP

Public Instance Methods

create_model_files() click to toggle source
# File lib/generators/ember/model_generator.rb, line 15
def create_model_files
  file_path = File.join(ember_path, 'models', class_path, "#{file_name}.#{engine_extension}")
  template "model.#{engine_extension}", file_path
end

Private Instance Methods

parse_attributes!() click to toggle source
# File lib/generators/ember/model_generator.rb, line 37
def parse_attributes!
  self.attributes = (attributes || []).map do |attr|
    name, type = attr.split(':')
    key = type.try(:to_sym)
    ember_type = EMBER_TYPE_LOOKUP[key] || type

    { :name => name, :type => ember_type }
  end
end