Class: Simplabs::Excellent::Parsing::CvarContext

Inherits:
SexpContext
  • Object
show all
Defined in:
lib/simplabs/excellent/parsing/cvar_context.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from SexpContext

#file, #line, #name, #parent

Instance Method Summary collapse

Methods inherited from SexpContext

#method_missing

Constructor Details

#initialize(exp, parent) ⇒ CvarContext

Returns a new instance of CvarContext.



9
10
11
12
# File 'lib/simplabs/excellent/parsing/cvar_context.rb', line 9

def initialize(exp, parent)
  super
  @name = exp[1].to_s.sub(/^@+/, '')
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Simplabs::Excellent::Parsing::SexpContext

Instance Method Details

#full_nameObject



14
15
16
17
18
19
20
# File 'lib/simplabs/excellent/parsing/cvar_context.rb', line 14

def full_name
  return @name if @parent.blank?
  full_name = @name
  parent    = @parent
  parent    = parent.parent until parent.is_a?(ClassContext) || parent.is_a?(ModuleContext)
  full_name = "#{parent.full_name}.#{full_name}"
end