Class: Guideline::OptionParser::Argument

Inherits:
Object
  • Object
show all
Defined in:
lib/guideline/option_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, description) ⇒ Argument

Returns a new instance of Argument.



56
57
58
59
# File 'lib/guideline/option_parser.rb', line 56

def initialize(key, description)
  @key         = key
  @description = description
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



54
55
56
# File 'lib/guideline/option_parser.rb', line 54

def description
  @description
end

#keyObject (readonly)

Returns the value of attribute key.



54
55
56
# File 'lib/guideline/option_parser.rb', line 54

def key
  @key
end

Instance Method Details

#to_symObject



61
62
63
64
65
66
67
68
# File 'lib/guideline/option_parser.rb', line 61

def to_sym
  str = @key
  str = without_head_hyphen(str)
  str = without_head_no(str)
  str = without_last_equal(str)
  str = underscored(str)
  str.to_sym
end