Class: Af::OptionParser::Option

Inherits:
InstanceVariableSetter show all
Defined in:
lib/fiksu-af/option_parser/option.rb

Constant Summary collapse

FACTORY_SETTABLES =
[
  :option_type,
  :requirements,
  :short_name,
  :argument_note,
  :note,
  :environment_variable,
  :default_value,
  :option_group_name,
  :choices
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from InstanceVariableSetter

#evaluate, #evaluate_and_set_target, #has_value_to_set_target_variable?, #instantiate_target_variable, #set_target_variable, #target_class_variable, #target_container, #target_instance_variable

Constructor Details

#initialize(long_name, parameters = {}) ⇒ Option

Returns a new instance of Option.



17
18
19
20
# File 'lib/fiksu-af/option_parser/option.rb', line 17

def initialize(long_name, parameters = {})
  super(parameters)
  @long_name = long_name
end

Instance Attribute Details

#long_nameObject

Returns the value of attribute long_name.



15
16
17
# File 'lib/fiksu-af/option_parser/option.rb', line 15

def long_name
  @long_name
end

Instance Method Details

#error(text) ⇒ Object



34
35
36
37
# File 'lib/fiksu-af/option_parser/option.rb', line 34

def error(text)
  puts "ERROR: #{self.long_name}: #{text} (--? for help)"
  exit 1
end

#merge(that_option) ⇒ Object



30
31
32
# File 'lib/fiksu-af/option_parser/option.rb', line 30

def merge(that_option)
  super(that_option, FACTORY_SETTABLES)
end

#set_instance_variables(parameters = {}) ⇒ Object


*** Instance Methods *** +++++++++++++++++++++++++



26
27
28
# File 'lib/fiksu-af/option_parser/option.rb', line 26

def set_instance_variables(parameters = {})
  super(parameters, FACTORY_SETTABLES)
end