Sha256: e3bbb58ba0678976a82552f142c0583b20233a371756f67293277bd1caf3ec8e

Contents?: true

Size: 317 Bytes

Versions: 4

Compression:

Stored size: 317 Bytes

Contents

module Yoda
  module AST
    class CaseNode < Node
      # @return [Node]
      def target
        children[0]
      end

      # @return [Array<Node>]
      def when_clauses
        children.slice(1..-2) || []
      end

      # @return [Node]
      def else_clause
        children.last
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yoda-language-server-0.10.1 lib/yoda/ast/case_node.rb
yoda-language-server-0.10.0 lib/yoda/ast/case_node.rb
yoda-language-server-0.9.0 lib/yoda/ast/case_node.rb
yoda-language-server-0.8.0 lib/yoda/ast/case_node.rb