Class: TomDoc::Arg
- Inherits:
-
Object
- Object
- TomDoc::Arg
- Defined in:
- lib/tomdoc/arg.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, description = '') ⇒ Arg
constructor
Create new Arg object.
-
#optional? ⇒ Boolean
Is this an optional argument?.
Constructor Details
#initialize(name, description = '') ⇒ Arg
Create new Arg object.
name - name of argument description - arguments description
10 11 12 13 |
# File 'lib/tomdoc/arg.rb', line 10 def initialize(name, description = '') @name = name.to_s.intern @description = description end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/tomdoc/arg.rb', line 3 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/tomdoc/arg.rb', line 3 def name @name end |
Instance Method Details
#optional? ⇒ Boolean
Is this an optional argument?
Returns Boolean.
18 19 20 |
# File 'lib/tomdoc/arg.rb', line 18 def optional? @description.downcase.include? 'optional' end |