Module: Boson::Command::Science

Included in:
Boson::Command
Defined in:
lib/boson/science.rb,
lib/boson/science.rb

Instance Method Summary collapse

Instance Method Details

#after_initialize(hash) ⇒ Object



194
195
196
197
198
199
# File 'lib/boson/science.rb', line 194

def after_initialize(hash)
  if hash[:render_options] && (@render_options = hash.delete(:render_options))[:output_class]
    @render_options = Util.recursive_hash_merge View.class_config(@render_options[:output_class]), @render_options
  end
  super
end

#make_option_command(lib = library) ⇒ Object



176
177
178
179
# File 'lib/boson/science.rb', line 176

def make_option_command(lib=library)
  @option_command = true
  @args = [['*args']] unless args(lib) || arg_size
end

#option_command?Boolean

Returns:

  • (Boolean)


181
182
183
# File 'lib/boson/science.rb', line 181

def option_command?
  super || render_options
end

#render_option_parserObject

Option parser for command as defined by @render_options.



172
173
174
# File 'lib/boson/science.rb', line 172

def render_option_parser
  option_command? ? Boson::Scientist.option_command(self).option_parser : nil
end