Class: Parameter
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#optional ⇒ Object
Returns the value of attribute optional.
Attributes inherited from Node
#children, #level, #name, #parent
Instance Method Summary collapse
-
#initialize(n = nil) ⇒ Parameter
constructor
A new instance of Parameter.
- #to_s ⇒ Object
Methods inherited from Node
#add_child, #all_children, #print, #print_children, #root, #root?
Constructor Details
#initialize(n = nil) ⇒ Parameter
Returns a new instance of Parameter.
206 207 208 209 |
# File 'lib/rest.rb', line 206 def initialize n = nil @optional = false super end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
204 205 206 |
# File 'lib/rest.rb', line 204 def description @description end |
#optional ⇒ Object
Returns the value of attribute optional.
204 205 206 |
# File 'lib/rest.rb', line 204 def optional @optional end |
Instance Method Details
#to_s ⇒ Object
211 212 213 214 215 216 217 218 219 |
# File 'lib/rest.rb', line 211 def to_s s = @name.to_s s += " (optional)" if @optional if ( !@description || @description.empty? ) s else s + " - " + @description end end |