Class: TypeCode

Inherits:
Object
  • Object
show all
Defined in:
lib/retrospec/type_code.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ TypeCode

TODO figure out how to store vardef statements that are contained inside conditional blocks



9
10
11
12
13
14
15
# File 'lib/retrospec/type_code.rb', line 9

def initialize(type)
  raise TypeNotFoundException unless type
  @scope_name = type.namespace
  @name = type.name
  @type = type
  @parent = type.parent
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/retrospec/type_code.rb', line 6

def name
  @name
end

#parentObject (readonly)

Returns the value of attribute parent.



6
7
8
# File 'lib/retrospec/type_code.rb', line 6

def parent
  @parent
end

#scope_nameObject (readonly)

Returns the value of attribute scope_name.



6
7
8
# File 'lib/retrospec/type_code.rb', line 6

def scope_name
  @scope_name
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/retrospec/type_code.rb', line 6

def type
  @type
end

#variablesObject (readonly)

returns a list of variables found in the main code block



22
23
24
# File 'lib/retrospec/type_code.rb', line 22

def variables
  @variables
end

Instance Method Details

#has_parent?Boolean

need to figure out a way to load the parent or dependent manfifests

Returns:

  • (Boolean)


17
18
19
# File 'lib/retrospec/type_code.rb', line 17

def has_parent?
  @parent.nil?
end