Sha256: fb767e59432c880e95b141868db5be1a4426f812dc7989e4dfc7c5bf21ae6152

Contents?: true

Size: 770 Bytes

Versions: 20

Compression:

Stored size: 770 Bytes

Contents

require 'simplabs/excellent/parsing/cyclomatic_complexity_measure'

module Simplabs

  module Excellent

    module Parsing

      class BlockContext < SexpContext #:nodoc:

        include CyclomaticComplexityMeasure
        include FlogMeasure

        attr_reader :parameters
        attr_reader :calls

        def initialize(exp, parent)
          super
          @parameters = []
          @name       = 'block'
          @line       = exp.line < exp[1].line ? exp.line : exp[1].line
          @calls      = Hash.new(0)
        end

        def full_name
          @name
        end

        def record_call_to(exp)
          @calls[exp] += 1
        end

        def inside_block?
          @parent.is_a?(BlockContext)
        end

      end

    end

  end

end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
simplabs-excellent-1.2.1 lib/simplabs/excellent/parsing/block_context.rb
simplabs-excellent-1.2.2 lib/simplabs/excellent/parsing/block_context.rb
simplabs-excellent-1.3.0 lib/simplabs/excellent/parsing/block_context.rb
simplabs-excellent-1.3.1 lib/simplabs/excellent/parsing/block_context.rb
simplabs-excellent-1.4.0 lib/simplabs/excellent/parsing/block_context.rb
simplabs-excellent-1.4.1 lib/simplabs/excellent/parsing/block_context.rb
simplabs-excellent-1.4.2 lib/simplabs/excellent/parsing/block_context.rb
simplabs-excellent-1.5.0 lib/simplabs/excellent/parsing/block_context.rb
simplabs-excellent-1.5.1 lib/simplabs/excellent/parsing/block_context.rb
simplabs-excellent-1.5.2 lib/simplabs/excellent/parsing/block_context.rb
simplabs-excellent-1.5.3 lib/simplabs/excellent/parsing/block_context.rb
excellent-2.1.1 lib/simplabs/excellent/parsing/block_context.rb
excellent-2.1.0 lib/simplabs/excellent/parsing/block_context.rb
excellent-2.0.1 lib/simplabs/excellent/parsing/block_context.rb
excellent-2.0.0 lib/simplabs/excellent/parsing/block_context.rb
excellent-1.7.2 lib/simplabs/excellent/parsing/block_context.rb
excellent-1.7.1 lib/simplabs/excellent/parsing/block_context.rb
excellent-1.7.0 lib/simplabs/excellent/parsing/block_context.rb
excellent-1.6.0 lib/simplabs/excellent/parsing/block_context.rb
excellent-1.5.4 lib/simplabs/excellent/parsing/block_context.rb