Class: RGitHook::Plugin::OptionGroup
Overview
- ::nodoc
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Todo: Make OptionGroup be an option of OptionGroup.
-
#name ⇒ Object
readonly
Todo: Make OptionGroup be an option of OptionGroup.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(name, description) ⇒ OptionGroup
constructor
A new instance of OptionGroup.
- #option(name, desc, default, type) ⇒ Object
-
#options_to_hash ⇒ Object
Rertun a hash with default options.
Constructor Details
#initialize(name, description) ⇒ OptionGroup
Returns a new instance of OptionGroup.
19 20 21 22 |
# File 'lib/rgithook/plugin.rb', line 19 def initialize(name,description) @name,@description = name,description @options = [] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Todo: Make OptionGroup be an option of OptionGroup
17 18 19 |
# File 'lib/rgithook/plugin.rb', line 17 def description @description end |
#name ⇒ Object (readonly)
Todo: Make OptionGroup be an option of OptionGroup
17 18 19 |
# File 'lib/rgithook/plugin.rb', line 17 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
18 19 20 |
# File 'lib/rgithook/plugin.rb', line 18 def @options end |
Instance Method Details
#option(name, desc, default, type) ⇒ Object
24 25 26 |
# File 'lib/rgithook/plugin.rb', line 24 def option(name,desc,default,type) @options << Option.new(name,desc,default,type) end |
#options_to_hash ⇒ Object
Rertun a hash with default options
30 31 32 33 34 35 36 |
# File 'lib/rgithook/plugin.rb', line 30 def = {} @options.each do |option| [option.name]= option.default end end |