class DMap::Commands

List available commands here

Attributes

options[RW]

Public Class Methods

cmd_new() click to toggle source

Each command has a cmd_ prefix

# File lib/dmap/core.rb, line 31
def self.cmd_new
  validations = DMap::Validations.list
  associations = DMap::Associations.list
  DMap::Tables.list.each do |k, table|
    properties = DMap::Properties.list[table]
    obj = $new_block.result(binding)

    if DMap::Commands.options['test'].nil? or DMap::Commands.options['test'] == false
      handler = File.new(table + ".rb", "w")
      handler.write(obj)
      handler.close
      p table.camelcase + " saved successfully"
    end

    if DMap::Commands.options['verbose'] == true
      puts obj
    end
  end
end
exists?(command) click to toggle source
# File lib/dmap/core.rb, line 22
def self.exists?(command)
  self.respond_to? "cmd_" + command
end
options() click to toggle source
# File lib/dmap/core.rb, line 26
def self.options
  @options ||= OrderedHash.new
end