Class: Helm::Commands::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/helm/application.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_config, options) ⇒ Command

Returns a new instance of Command.



7
8
9
10
# File 'lib/helm/application.rb', line 7

def initialize(app_config, options)
  @app_config = app_config
  @options = options
end

Instance Attribute Details

#app_configObject

Returns the value of attribute app_config.



11
12
13
# File 'lib/helm/application.rb', line 11

def app_config
  @app_config
end

#optionsObject

Returns the value of attribute options.



11
12
13
# File 'lib/helm/application.rb', line 11

def options
  @options
end

Instance Method Details

#if_option(name) ⇒ Object



13
14
15
16
17
# File 'lib/helm/application.rb', line 13

def if_option(name)
  if options.has_key?(name.to_s)
    yield(options[name])
  end
end