Class: DMap::Commands
- Inherits:
-
Object
- Object
- DMap::Commands
- Defined in:
- lib/dmap/core.rb
Overview
List available commands here
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
-
.cmd_new ⇒ Object
Each command has a cmd_ prefix.
- .exists?(command) ⇒ Boolean
- .options ⇒ Object
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
20 21 22 |
# File 'lib/dmap/core.rb', line 20 def @options end |
Class Method Details
.cmd_new ⇒ Object
Each command has a cmd_ prefix
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# 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.['test'].nil? or DMap::Commands.['test'] == false handler = File.new(table + ".rb", "w") handler.write(obj) handler.close p table.camelcase + " saved successfully" end if DMap::Commands.['verbose'] == true puts obj end end end |
.exists?(command) ⇒ Boolean
22 23 24 |
# File 'lib/dmap/core.rb', line 22 def self.exists?(command) self.respond_to? "cmd_" + command end |
.options ⇒ Object
26 27 28 |
# File 'lib/dmap/core.rb', line 26 def self. @options ||= OrderedHash.new end |