Class: Autodoc::Document::Parameter
- Inherits:
-
Object
- Object
- Autodoc::Document::Parameter
- Defined in:
- lib/autodoc/document.rb
Instance Attribute Summary collapse
-
#validator ⇒ Object
readonly
Returns the value of attribute validator.
Instance Method Summary collapse
-
#initialize(validator) ⇒ Parameter
constructor
A new instance of Parameter.
- #to_s ⇒ Object
Constructor Details
#initialize(validator) ⇒ Parameter
Returns a new instance of Parameter.
223 224 225 |
# File 'lib/autodoc/document.rb', line 223 def initialize(validator) @validator = validator end |
Instance Attribute Details
#validator ⇒ Object (readonly)
Returns the value of attribute validator.
221 222 223 |
# File 'lib/autodoc/document.rb', line 221 def validator @validator end |
Instance Method Details
#to_s ⇒ Object
227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/autodoc/document.rb', line 227 def to_s string = "" string << "#{body}#{payload}" if validator.respond_to? :validators validator.validators.each do |x| string << "\n" string << Parameter.new(x).to_s.indent(2) end end string end |