class ArticleFixtureGen::Exe::Trollop::OptionSpec
Encapsulate configuration of a Trollop
command-line option
Public Class Methods
new(*key_and_desc, **options)
click to toggle source
# File lib/article_fixture_gen/exe/option_parser/trollop/option_spec.rb, line 14 def initialize(*key_and_desc, **options) @item = OptionSpecItem.new key: key_and_desc[0], desc: key_and_desc[1], options: options # freeze # Cannot freeze data passed to `Trollop.opt`. # WTFometer at 11. self end
Public Instance Methods
add_option(context)
click to toggle source
# File lib/article_fixture_gen/exe/option_parser/trollop/option_spec.rb, line 22 def add_option(context) context.opt key, desc, options end