Sha256: e1a418be89f604aefb47c93bae0c2188863a5dbd43403dfc526ef57c302ea74d

Contents?: true

Size: 538 Bytes

Versions: 2

Compression:

Stored size: 538 Bytes

Contents

# frozen_string_literal: true

module DeepCover
  class Analyser::Node < Analyser
    def is_raise?(node)
      node.is_a?(Node::Send) && (node.message == :raise || node.message == :exit)
    end

    def is_default_argument?(node)
      node.parent.is_a?(Node::Optarg)
    end

    def is_case_implicit_else?(node)
      parent = node.parent
      node.is_a?(Node::EmptyBody) && parent.is_a?(Node::Case) && !parent.has_else?
    end

    protected

    def convert(node, **)
      Analyser::CoveredCodeSource.new(node)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
deep-cover-0.1.16 lib/deep_cover/analyser/node.rb
deep-cover-0.1.15 lib/deep_cover/analyser/node.rb