class BranchIOCLI::Command::Command

Attributes

config[R]
options[R]

Public Class Methods

available_options() click to toggle source
# File lib/branch_io_cli/command/command.rb, line 16
def available_options
  configuration_class.available_options
end
command_name() click to toggle source
# File lib/branch_io_cli/command/command.rb, line 5
def command_name
  matches = /BranchIOCLI::Command::(\w+)Command/.match name
  matches[1].downcase
end
configuration_class() click to toggle source
# File lib/branch_io_cli/command/command.rb, line 10
def configuration_class
  root = command_name.capitalize

  BranchIOCLI::Configuration.const_get("#{root}Configuration")
end
examples() click to toggle source
# File lib/branch_io_cli/command/command.rb, line 20
def examples
  configuration_class.examples if configuration_class.respond_to?(:examples)
end
new(options) click to toggle source
# File lib/branch_io_cli/command/command.rb, line 32
def initialize(options)
  @options = options
  @config = self.class.configuration_class.new options
end
return_value() click to toggle source
# File lib/branch_io_cli/command/command.rb, line 24
def return_value
  configuration_class.return_value if configuration_class.respond_to?(:return_value)
end

Public Instance Methods

env() click to toggle source
# File lib/branch_io_cli/command/command.rb, line 53
def env
  Configuration::Environment
end
helper() click to toggle source
# File lib/branch_io_cli/command/command.rb, line 41
def helper
  Helper::BranchHelper
end
patch_helper() click to toggle source
# File lib/branch_io_cli/command/command.rb, line 45
def patch_helper
  Helper::PatchHelper
end
run!() click to toggle source
# File lib/branch_io_cli/command/command.rb, line 37
def run!
  # implemented by subclasses
end
tool_helper() click to toggle source
# File lib/branch_io_cli/command/command.rb, line 49
def tool_helper
  Helper::ToolHelper
end