lib/fukuzatsu/parsed_method.rb in fukuzatsu-0.9.13 vs lib/fukuzatsu/parsed_method.rb in fukuzatsu-0.9.14
- old
+ new
@@ -1,17 +1,19 @@
-require 'parser/current'
-
class ParsedMethod
include PoroPlus
- attr_accessor :name, :content, :type
+ attr_accessor :name, :content, :type, :complexity
def complexity
- @complexity ||= Analyzer.new(content).complexity
+ @complexity ||= analyzer.complexity
end
def prefix
- self.type == :class ? "." : "#"
+ self.type.to_s == 'class' ? "." : "#"
+ end
+
+ def analyzer
+ Analyzer.new(self.content)
end
end
\ No newline at end of file