Class: Sal::Class

Inherits:
Object
  • Object
show all
Defined in:
lib/sal/class.rb

Overview

The class repressents a class in the code

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item) ⇒ Class

Returns a new instance of Class.



8
9
10
11
12
13
14
# File 'lib/sal/class.rb', line 8

def initialize( item )
  @item = item
  item.code.chomp =~ /^(.*? Class): (.*)$/
  @type = $1
  @name = $2
  @functions = nil
end

Instance Attribute Details

#itemObject

Returns the value of attribute item.



16
17
18
# File 'lib/sal/class.rb', line 16

def item
  @item
end

#nameObject

Returns the value of attribute name.



16
17
18
# File 'lib/sal/class.rb', line 16

def name
  @name
end

#typeObject

Returns the value of attribute type.



16
17
18
# File 'lib/sal/class.rb', line 16

def type
  @type
end

Instance Method Details

#functionsObject

Getter for the functions (lazy loading)



19
20
21
22
23
24
# File 'lib/sal/class.rb', line 19

def functions
  if( @functions.nil? )            
    _analyze            
  end
  return @functions
end