Method: Cmds#initialize
- Defined in:
- lib/cmds.rb
#initialize(template, **options) ⇒ Cmds
Construct a Cmds
instance.
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/cmds.rb', line 237 def initialize template, ** = defaults if .key? :opts [:kwds][:opts] = .delete :opts end logger.trace "Cmd constructing...", template: template, options: @template = template # Assign options to instance variables .each { |key, value| instance_variable_set "@#{ key }", value } # An internal cache of the last result of calling {#prepare}, or `nil` if # {#prepare} has never been called. Kinda funky but ends up being useful. @last_prepared_cmd = nil end |