class Courtier::Setup
Tool configuration setup is used to customize how a tool handles configuration.
Attributes
feature[R]
Feature for which this is the configuration setup.
Public Class Methods
new(feature, options={}, &block)
click to toggle source
Intialize new configuration setup.
# File lib/courtier/setup.rb, line 11 def initialize(feature, options={}, &block) @feature = feature.to_s @command = @feature @command = options[:command] || options[:tool] if options.key?(:command) || options.key?(:tool) @profile = options[:profile] if options.key?(:profile) @block = block end
Public Instance Methods
call(config)
click to toggle source
# File lib/courtier/setup.rb, line 30 def call(config) return unless config.command == @command.to_s if @command return unless config.profile == @profile.to_s if @profile @block.call(config) end
to_proc()
click to toggle source
# File lib/courtier/setup.rb, line 40 def to_proc @block end