Class: SfCli::Sf::Main

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/sf_cli/sf/main.rb

Overview

The entry class of sf command. It is returned by the sf method. With including Singleton module, the instance of this class is guaranteed as singleton.

Examples:

sf             # returns a instance of SfCli::Sf
sf.org.display # you can follow the similar syntax to the original command by using method chain.

Constant Summary collapse

OPERATION_CATEGORIES =
%w[Org Sobject Data Project Apex]

Instance Method Summary collapse

Constructor Details

#initializeMain

Generate each sub command object such as org, data and sobject so that it can chain like ‘sf.org.display`.



28
29
30
31
32
# File 'lib/sf_cli/sf/main.rb', line 28

def initialize
  OPERATION_CATEGORIES.each do |category|
    instance_variable_set(:"@#{category.downcase}", Object.const_get(%|::SfCli::Sf::#{category}::Core|).new)
  end
end