class ROM::Generators::CommandsGenerator

Public Instance Methods

create_create_command() click to toggle source
# File lib/generators/rom/commands_generator.rb, line 11
def create_create_command
  template 'create.rb.erb', command_file(:create)
end
create_delete_command() click to toggle source
# File lib/generators/rom/commands_generator.rb, line 19
def create_delete_command
  template 'delete.rb.erb', command_file(:delete)
end
create_update_command() click to toggle source
# File lib/generators/rom/commands_generator.rb, line 15
def create_update_command
  template 'update.rb.erb', command_file(:update)
end

Private Instance Methods

adapter() click to toggle source
# File lib/generators/rom/commands_generator.rb, line 37
def adapter
  options[:adapter]
end
command_file(command) click to toggle source
# File lib/generators/rom/commands_generator.rb, line 25
def command_file(command)
  File.join('app', 'commands', "#{command}_#{model_name.downcase}.rb")
end
model_name() click to toggle source
# File lib/generators/rom/commands_generator.rb, line 33
def model_name
  class_name.singularize
end
relation() click to toggle source
# File lib/generators/rom/commands_generator.rb, line 29
def relation
  class_name.pluralize.underscore
end