Sha256: 410d26865026ea026eeed38cfc347d9e67aa092c8c42900a2029e2de6fe4f4d9

Contents?: true

Size: 642 Bytes

Versions: 4

Compression:

Stored size: 642 Bytes

Contents

# frozen_string_literal: true

module Phlex::Compiler::Nodes
	class MethodAddBlock < Base
		def name
			method_call.name
		end

		def arguments
			method_call.arguments
		end

		def method_call
			@method_call ||= case @node.call
			in SyntaxTree::FCall
				Phlex::Compiler::Nodes::FCall.new(@node.call)
			in SyntaxTree::Command
				Phlex::Compiler::Nodes::Command.new(@node.call)
			in SyntaxTree::Call
				Phlex::Compiler::Nodes::Call.new(@node.call)
			end
		end

		def content
			case @node.block
			in SyntaxTree::BraceBlock
				@node.block.statements
			in SyntaxTree::DoBlock
				@node.block.bodystmt.statements
			end
		end
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
phlex-0.5.3 lib/phlex/compiler/nodes/method_add_block.rb
phlex-0.5.2 lib/phlex/compiler/nodes/method_add_block.rb
phlex-0.5.1 lib/phlex/compiler/nodes/method_add_block.rb
phlex-0.5.0 lib/phlex/compiler/nodes/method_add_block.rb