Sha256: 2a0c72680831357df8f17cc22b067f51aadf4aefed738f6dc0f2e511c28c6996
Contents?: true
Size: 705 Bytes
Versions: 21
Compression:
Stored size: 705 Bytes
Contents
class Code class Object class RubyFunction < ::Code::Object::Function attr_reader :raw def initialize(raw) @raw = raw end private def call_function(args:, globals:) regular_arguments = args .select(&:regular?) .map(&:value) .map { |argument| ::Code::Ruby.from_code(argument) } keyword_arguments = args .select(&:keyword?) .map do |argument| [argument.name.to_sym, ::Code::Ruby.from_code(argument.value)] end .to_h ::Code::Ruby.to_code(raw.call(*regular_arguments, **keyword_arguments)) end end end end
Version data entries
21 entries across 21 versions & 3 rubygems