Class: ApiExplorer::Parameter
- Inherits:
-
Object
- Object
- ApiExplorer::Parameter
- Defined in:
- lib/api_explorer/parameter.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
-
#params ⇒ Object
Returns the value of attribute params.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type_or_children, description) ⇒ Parameter
constructor
A new instance of Parameter.
Constructor Details
#initialize(name, type_or_children, description) ⇒ Parameter
Returns a new instance of Parameter.
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/api_explorer/parameter.rb', line 3 def initialize(name, type_or_children, description) self.name = name.to_s self.description = description if type_or_children.is_a?(Array) self.type = :hash self.params = type_or_children else self.type = type_or_children.to_s.to_sym end end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
14 15 16 |
# File 'lib/api_explorer/parameter.rb', line 14 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/api_explorer/parameter.rb', line 14 def name @name end |
#params ⇒ Object
Returns the value of attribute params.
14 15 16 |
# File 'lib/api_explorer/parameter.rb', line 14 def params @params end |
#type ⇒ Object
Returns the value of attribute type.
14 15 16 |
# File 'lib/api_explorer/parameter.rb', line 14 def type @type end |