Class: ApiExplorer::Parameter

Inherits:
Object
  • Object
show all
Defined in:
lib/api_explorer/parameter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject

Returns the value of attribute description.



14
15
16
# File 'lib/api_explorer/parameter.rb', line 14

def description
  @description
end

#nameObject

Returns the value of attribute name.



14
15
16
# File 'lib/api_explorer/parameter.rb', line 14

def name
  @name
end

#paramsObject

Returns the value of attribute params.



14
15
16
# File 'lib/api_explorer/parameter.rb', line 14

def params
  @params
end

#typeObject

Returns the value of attribute type.



14
15
16
# File 'lib/api_explorer/parameter.rb', line 14

def type
  @type
end