Class: TomDoc::Arg

Inherits:
Object
  • Object
show all
Defined in:
lib/tomdoc/arg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, description = '') ⇒ Arg

Returns a new instance of Arg.



5
6
7
8
# File 'lib/tomdoc/arg.rb', line 5

def initialize(name, description = '')
  @name = name.to_s.intern
  @description = description
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/tomdoc/arg.rb', line 3

def description
  @description
end

#nameObject

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

Returns:

  • (Boolean)


10
11
12
# File 'lib/tomdoc/arg.rb', line 10

def optional?
  @description.downcase.include? 'optional'
end