Class: ApiExplorer::Group

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

Direct Known Subclasses

Description

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #parent, #path

Instance Method Summary collapse

Methods inherited from Node

#full_path

Constructor Details

#initialize(title, path = "", children = [], shared_headers = [], shared_params = []) ⇒ Group

Returns a new instance of Group.



5
6
7
8
9
10
11
# File 'lib/api_explorer/group.rb', line 5

def initialize(title, path = "", children = [], shared_headers = [], shared_params = [])
  super nil, children, path

  self.title   = title
  self.headers = shared_headers
  self.params  = shared_params
end

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



3
4
5
# File 'lib/api_explorer/group.rb', line 3

def headers
  @headers
end

#paramsObject

Returns the value of attribute params.



3
4
5
# File 'lib/api_explorer/group.rb', line 3

def params
  @params
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/api_explorer/group.rb', line 3

def title
  @title
end

Instance Method Details

#add_child(child) ⇒ Object



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

def add_child(child)
  children << child
  child.parent = self
end