Class: Apige::Context::Scope

Inherits:
Object
  • Object
show all
Defined in:
lib/apige/context/scope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = '', type = 'top', parent = nil, level = 1) ⇒ Scope

Returns a new instance of Scope.



4
5
6
7
8
9
10
11
12
# File 'lib/apige/context/scope.rb', line 4

def initialize(name='', type='top', parent=nil, level=1)
  @level = level
  @apis = []
  @name = name
  @type = type
  @parent = parent
  @children = []
  @description = ''
end

Instance Attribute Details

#apisObject

Returns the value of attribute apis.



14
15
16
# File 'lib/apige/context/scope.rb', line 14

def apis
  @apis
end

#childrenObject

Returns the value of attribute children.



14
15
16
# File 'lib/apige/context/scope.rb', line 14

def children
  @children
end

#descriptionObject

Returns the value of attribute description.



14
15
16
# File 'lib/apige/context/scope.rb', line 14

def description
  @description
end

#levelObject

Returns the value of attribute level.



14
15
16
# File 'lib/apige/context/scope.rb', line 14

def level
  @level
end

#metaObject

Returns the value of attribute meta.



14
15
16
# File 'lib/apige/context/scope.rb', line 14

def meta
  @meta
end

#nameObject

Returns the value of attribute name.



14
15
16
# File 'lib/apige/context/scope.rb', line 14

def name
  @name
end

#parentObject

Returns the value of attribute parent.



14
15
16
# File 'lib/apige/context/scope.rb', line 14

def parent
  @parent
end

#typeObject

Returns the value of attribute type.



14
15
16
# File 'lib/apige/context/scope.rb', line 14

def type
  @type
end

Instance Method Details

#new_child(name, type) ⇒ Object



16
17
18
19
20
# File 'lib/apige/context/scope.rb', line 16

def new_child(name, type)
  scope = Scope.new(name, type, self, @level+1)
  @children << scope
  scope
end