Class: ConfigTable::Item
Direct Known Subclasses
BoolItem, ExecItem, PackageSelectionItem, PathItem, ProgramItem, SelectItem
Instance Attribute Summary collapse
-
#default ⇒ Object
(also: #help_default)
Returns the value of attribute default.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #help_opt ⇒ Object
-
#initialize(name, template, default, desc) ⇒ Item
constructor
A new instance of Item.
- #resolve(table) ⇒ Object
- #set(val) ⇒ Object
- #value ⇒ Object
- #value? ⇒ Boolean
Constructor Details
#initialize(name, template, default, desc) ⇒ Item
Returns a new instance of Item.
319 320 321 322 323 324 325 |
# File 'lib/gems/xmpp4r-0.4/setup.rb', line 319 def initialize(name, template, default, desc) @name = name.freeze @template = template @value = default @default = default @description = desc end |
Instance Attribute Details
#default ⇒ Object Also known as: help_default
Returns the value of attribute default.
330 331 332 |
# File 'lib/gems/xmpp4r-0.4/setup.rb', line 330 def default @default end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
328 329 330 |
# File 'lib/gems/xmpp4r-0.4/setup.rb', line 328 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
327 328 329 |
# File 'lib/gems/xmpp4r-0.4/setup.rb', line 327 def name @name end |
Instance Method Details
#help_opt ⇒ Object
333 334 335 |
# File 'lib/gems/xmpp4r-0.4/setup.rb', line 333 def help_opt "--#{@name}=#{@template}" end |
#resolve(table) ⇒ Object
345 346 347 |
# File 'lib/gems/xmpp4r-0.4/setup.rb', line 345 def resolve(table) @value.gsub(%r<\$([^/]+)>) { table[$1] } end |
#set(val) ⇒ Object
349 350 351 |
# File 'lib/gems/xmpp4r-0.4/setup.rb', line 349 def set(val) @value = check(val) end |
#value ⇒ Object
341 342 343 |
# File 'lib/gems/xmpp4r-0.4/setup.rb', line 341 def value @value end |
#value? ⇒ Boolean
337 338 339 |
# File 'lib/gems/xmpp4r-0.4/setup.rb', line 337 def value? true end |