Class: Cog::Generator::LanguageMethods::Scope
- Inherits:
-
Object
- Object
- Cog::Generator::LanguageMethods::Scope
- Defined in:
- lib/cog/generator/language_methods/scope.rb
Overview
Defines a program scope
Instance Attribute Summary collapse
-
#name ⇒ String?
readonly
Name of the scope.
-
#type ⇒ Symbol
readonly
Type of the scope.
Instance Method Summary collapse
-
#initialize(type, name = nil) ⇒ Scope
constructor
A new instance of Scope.
Constructor Details
#initialize(type, name = nil) ⇒ Scope
Returns a new instance of Scope.
16 17 18 19 |
# File 'lib/cog/generator/language_methods/scope.rb', line 16 def initialize(type, name=nil) @type = type.to_sym @name = name end |
Instance Attribute Details
#name ⇒ String? (readonly)
Returns name of the scope.
12 13 14 |
# File 'lib/cog/generator/language_methods/scope.rb', line 12 def name @name end |
#type ⇒ Symbol (readonly)
Returns type of the scope. For example, :include_guard
.
9 10 11 |
# File 'lib/cog/generator/language_methods/scope.rb', line 9 def type @type end |