Class: YARD::Amp::OptionObject
- Inherits:
-
CodeObjects::Base
- Object
- CodeObjects::Base
- YARD::Amp::OptionObject
- Defined in:
- lib/yard-amp/option.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(namespace, name, description, opts = {}, *args) ⇒ OptionObject
constructor
A new instance of OptionObject.
- #signature ⇒ Object
Constructor Details
#initialize(namespace, name, description, opts = {}, *args) ⇒ OptionObject
Returns a new instance of OptionObject.
4 5 6 7 8 |
# File 'lib/yard-amp/option.rb', line 4 def initialize(namespace, name, description, opts = {}, *args) super self.description, self. = description, opts opts["type"] ||= "flag" end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/yard-amp/option.rb', line 3 def description @description end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/yard-amp/option.rb', line 3 def @options end |
Instance Method Details
#signature ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/yard-amp/option.rb', line 10 def signature "--#{self.name}" + (["short"] && ["short"] != "none" ? ", -#{["short"]}" : "") + case ["type"] when "flag"; "" when "int"; " <i>" when "ints"; " <i+>" when "string"; " <s>" when "strings"; " <s+>" when "float"; " <f>" when "floats"; " <f+>" when "io"; " <filename/uri>" when "ios"; " <filename/uri+>" end.to_s end |