Class: Snuffle::SourceFile
- Inherits:
-
Object
- Object
- Snuffle::SourceFile
- Includes:
- PoroPlus
- Defined in:
- lib/snuffle/source_file.rb
Instance Attribute Summary collapse
-
#lines_of_code ⇒ Object
Returns the value of attribute lines_of_code.
-
#path_to_file ⇒ Object
Returns the value of attribute path_to_file.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #arg_clumps ⇒ Object
- #class_name ⇒ Object
- #cohorts ⇒ Object
- #latent_objects ⇒ Object
- #nodes ⇒ Object
- #summary ⇒ Object
Instance Attribute Details
#lines_of_code ⇒ Object
Returns the value of attribute lines_of_code.
11 12 13 |
# File 'lib/snuffle/source_file.rb', line 11 def lines_of_code @lines_of_code end |
#path_to_file ⇒ Object
Returns the value of attribute path_to_file.
11 12 13 |
# File 'lib/snuffle/source_file.rb', line 11 def path_to_file @path_to_file end |
#source ⇒ Object
Returns the value of attribute source.
11 12 13 |
# File 'lib/snuffle/source_file.rb', line 11 def source @source end |
Instance Method Details
#arg_clumps ⇒ Object
22 23 24 |
# File 'lib/snuffle/source_file.rb', line 22 def arg_clumps @arg_clumps ||= ArgsClump.from(self.nodes) end |
#class_name ⇒ Object
13 14 15 16 |
# File 'lib/snuffle/source_file.rb', line 13 def class_name return @class_name if @class_name @class_name = find_class(ast) || "?" end |
#cohorts ⇒ Object
26 27 28 |
# File 'lib/snuffle/source_file.rb', line 26 def cohorts @cohorts ||= Cohort.from(self.nodes) end |
#latent_objects ⇒ Object
30 31 32 |
# File 'lib/snuffle/source_file.rb', line 30 def latent_objects @latent_objects ||= LatentObject.from(self.nodes) end |
#nodes ⇒ Object
18 19 20 |
# File 'lib/snuffle/source_file.rb', line 18 def nodes @nodes ||= extract_nodes_from(ast) end |
#summary ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/snuffle/source_file.rb', line 46 def summary Summary.new( source_file: self, source: self.source, class_name: class_name, path_to_file: self.path_to_file, cohorts: cohorts, latent_objects: latent_objects, arg_clumps: arg_clumps ) end |