Class: AutoC::Module::Source

Inherits:
Object
  • Object
show all
Includes:
EntityContainer, SmartRenderer
Defined in:
lib/autoc/module.rb

Instance Attribute Summary collapse

Attributes included from SmartRenderer

#digest

Instance Method Summary collapse

Methods included from SmartRenderer

#render

Methods included from EntityContainer

#entities

Constructor Details

#initialize(m, index) ⇒ Source



263
264
265
266
267
# File 'lib/autoc/module.rb', line 263

def initialize(m, index)
  @module = m
  @complexity = 0
  @index = index
end

Instance Attribute Details

#complexityObject (readonly)

Returns the value of attribute complexity.



257
258
259
# File 'lib/autoc/module.rb', line 257

def complexity
  @complexity
end

#indexObject (readonly)

Returns the value of attribute index.



259
260
261
# File 'lib/autoc/module.rb', line 259

def index
  @index
end

#moduleObject (readonly)

Returns the value of attribute module.



255
256
257
# File 'lib/autoc/module.rb', line 255

def module
  @module
end

Instance Method Details

#<<(entity) ⇒ Object



269
270
271
272
# File 'lib/autoc/module.rb', line 269

def <<(entity)
  @complexity += entity.complexity unless entities.include?(entity)
  super
end

#file_nameObject



261
# File 'lib/autoc/module.rb', line 261

def file_name = self.module.source_count < 2 ? "#{self.module.name}_auto.c" : "#{self.module.name}_auto#{index}.c"