Class: Apige::Context::Scope
- Inherits:
-
Object
- Object
- Apige::Context::Scope
- Defined in:
- lib/apige/context/scope.rb
Instance Attribute Summary collapse
-
#apis ⇒ Object
Returns the value of attribute apis.
-
#children ⇒ Object
Returns the value of attribute children.
-
#description ⇒ Object
Returns the value of attribute description.
-
#level ⇒ Object
Returns the value of attribute level.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name = '', type = 'top', parent = nil, level = 1) ⇒ Scope
constructor
A new instance of Scope.
- #new_child(name, type) ⇒ Object
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
#apis ⇒ Object
Returns the value of attribute apis.
14 15 16 |
# File 'lib/apige/context/scope.rb', line 14 def apis @apis end |
#children ⇒ Object
Returns the value of attribute children.
14 15 16 |
# File 'lib/apige/context/scope.rb', line 14 def children @children end |
#description ⇒ Object
Returns the value of attribute description.
14 15 16 |
# File 'lib/apige/context/scope.rb', line 14 def description @description end |
#level ⇒ Object
Returns the value of attribute level.
14 15 16 |
# File 'lib/apige/context/scope.rb', line 14 def level @level end |
#meta ⇒ Object
Returns the value of attribute meta.
14 15 16 |
# File 'lib/apige/context/scope.rb', line 14 def end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/apige/context/scope.rb', line 14 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent.
14 15 16 |
# File 'lib/apige/context/scope.rb', line 14 def parent @parent end |
#type ⇒ Object
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 |