Module: TabTab::Definition

Defined in:
lib/tabtab/definitions.rb,
lib/tabtab/definitions/flag.rb,
lib/tabtab/definitions/root.rb,
lib/tabtab/definitions/command.rb,
lib/tabtab/definitions/default.rb

Defined Under Namespace

Classes: Base, Command, Default, Flag, InvalidDefinitionBlockArguments, Root

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.registrationsObject (readonly)

Returns the value of attribute registrations.



5
6
7
# File 'lib/tabtab/definitions.rb', line 5

def registrations
  @registrations
end

Class Method Details

.[](app_name) ⇒ Object



12
13
14
# File 'lib/tabtab/definitions.rb', line 12

def [](app_name)
  registrations[app_name]
end

.app_namesObject



20
21
22
# File 'lib/tabtab/definitions.rb', line 20

def app_names
  registrations.keys
end

.clearObject



16
17
18
# File 'lib/tabtab/definitions.rb', line 16

def clear
  @registrations = {}
end

.register(app_name, options = {}, &block) ⇒ Object



7
8
9
10
# File 'lib/tabtab/definitions.rb', line 7

def register(app_name, options={}, &block)
  @registrations ||= {}
  registrations[app_name] = Root.named(app_name, options, &block)
end