Class: AutoC::Module::Source
- Inherits:
-
Object
- Object
- AutoC::Module::Source
- Includes:
- EntityContainer, SmartRenderer
- Defined in:
- lib/autoc/module.rb
Instance Attribute Summary collapse
-
#complexity ⇒ Object
readonly
Returns the value of attribute complexity.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#module ⇒ Object
readonly
Returns the value of attribute module.
Attributes included from SmartRenderer
Instance Method Summary collapse
- #<<(entity) ⇒ Object
- #file_name ⇒ Object
-
#initialize(m, index) ⇒ Source
constructor
A new instance of Source.
Methods included from SmartRenderer
Methods included from EntityContainer
Constructor Details
#initialize(m, index) ⇒ Source
Returns a new instance of Source.
262 263 264 265 266 |
# File 'lib/autoc/module.rb', line 262 def initialize(m, index) @module = m @complexity = 0 @index = index end |
Instance Attribute Details
#complexity ⇒ Object (readonly)
Returns the value of attribute complexity.
256 257 258 |
# File 'lib/autoc/module.rb', line 256 def complexity @complexity end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
258 259 260 |
# File 'lib/autoc/module.rb', line 258 def index @index end |
#module ⇒ Object (readonly)
Returns the value of attribute module.
254 255 256 |
# File 'lib/autoc/module.rb', line 254 def module @module end |
Instance Method Details
#<<(entity) ⇒ Object
268 269 270 271 |
# File 'lib/autoc/module.rb', line 268 def <<(entity) @complexity += entity.complexity unless entities.include?(entity) super end |
#file_name ⇒ Object
260 |
# File 'lib/autoc/module.rb', line 260 def file_name = self.module.source_count < 2 ? "#{self.module.name}_auto.c" : "#{self.module.name}_auto#{index}.c" |