Sha256: 6bf5c0aa4bb92a34cda3cafce2b1eb4807483d13fe9683d4d4d127b752144a1c
Contents?: true
Size: 1.52 KB
Versions: 1
Compression:
Stored size: 1.52 KB
Contents
require 'inch/language/elixir/provider/reader_v2/object/function_parameter_object' module Inch module Language module Elixir module Provider module ReaderV2 module Object # Proxy class for functions class FunctionObject < Base def method? true end def parameters names = FunctionSignature.new(@hash['signature']).parameter_names names.map do |name| FunctionParameterObject.new(self, name) end end private class FunctionSignature < Struct.new(:signature) def parameter_names return [] if signature.nil? signature.map do |tuple| name_from_tuple(*tuple) end end def name_from_tuple(a, _, b) if b.nil? || b == 'Elixir' a else if a == '\\\\' candidate = b.first if candidate.is_a?(Array) name_from_tuple(*candidate) else candidate end else warn "[WARN] could not parse FunctionSignature: #{[a, _, b].inspect}" end end end end end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
inch-0.9.0.rc1 | lib/inch/language/elixir/provider/reader_v2/object/function_object.rb |