BasicObject
# File lib/main/dsl.rb, line 5 def argument(*a, &b) (parameters << Parameter.create(:argument, self, *a, &b)).last end
# File lib/main/dsl.rb, line 37 def can_has(ptype, *a, &b) key = a.map{|s| s.to_s}.sort_by{|s| -s.size }.first can_has_hash.update key => [ptype, a, b] key end
# File lib/main/dsl.rb, line 26 def default_options! option 'help', 'h' unless parameters.has_option?('help', 'h') end
# File lib/main/dsl.rb, line 21 def environment(*a, &b) (parameters << Parameter.create(:environment, self, *a, &b)).last end
# File lib/main/dsl.rb, line 43 def has(key, *keys) keys = [key, *keys].flatten.compact.map{|k| k.to_s} keys.map do |key| ptype, a, b = can_has_hash[key] abort "yo - can *not* has #{ key.inspect }!?" unless(ptype and a and b) send ptype, *a, &b key end end
# File lib/main/dsl.rb, line 16 def keyword(*a, &b) (parameters << Parameter.create(:keyword, self, *a, &b)).last end
# File lib/main/dsl.rb, line 53 def mixin(name, *names, &block) names = [name, *names].flatten.compact.map{|name| name.to_s} if block names.each do |name| mixin_table[name] = block end else names.each do |name| module_eval(&mixin_table[name]) end end end
# File lib/main/dsl.rb, line 30 def mode(name, &block) name = name.to_s modes[name] = block block.fattr(:name => name) block end
# File lib/main/dsl.rb, line 10 def option(*a, &b) (parameters << Parameter.create(:option, self, *a, &b)).last end
Generated with the Darkfish Rdoc Generator 2.