GitHub PullRequestReviewCommentEvent at 2014-04-21 22:06:53
Repository: puppet
Actor: jpartlow
Payload: {"comment":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/11828819","id":11828819,"diff_hunk":"@@ -535,26 +308,47 @@ def arg_count(min_occurs, max_occurs)\n \n     # Specifies that the last argument captures the rest.\n     #\n+    # @api public\n     def last_captures_rest\n       @last_captures = true\n     end\n \n+    private\n+\n+    # @api private\n+    def dispatch(meth_name, &block)\n+      # an array of either an index into names/types, or an array with\n+      # injection information [type, name, injection_name] used when the call\n+      # is being made to weave injections into the given arguments.\n+      #\n+      @types = []\n+      @names = []\n+      @weaving = []\n+      @injections = []\n+      @min = nil\n+      @max = nil\n+      @last_captures = false\n+      @block_type = nil\n+      @block_name = nil\n+      self.instance_eval &block\n+      callable_t = create_callable(@types, @block_type, @min, @max)\n+      @dispatcher.add_dispatch(callable_t, meth_name, @names, @block_name, @injections, @weaving, @last_captures)\n+    end\n+\n     # Handles creation of a callable type from strings, puppet types, or ruby types and allows\n     # the min/max occurs of the given types to be given as one or two integer values at the end.\n     # The given block_type should be Optional[Callable], Callable, or nil.\n     #\n-    def self.create_callable(types, block_type, from, to)\n+    # @api private\n+    def create_callable(types, block_type, from, to)\n       mapped_types = types.map do |t|\n         case t\n         when String\n-          type_parser ||= Puppet::Pops::Types::TypeParser.new\n-          type_parser.parse(t)\n-        when Puppet::Pops::Types::PAbstractType\n-          t\n+          @type_parser.parse(t)\n         when Class\n           Puppet::Pops::Types::TypeFactory.type_of(t)\n         else\n-          raise ArgumentError, \"Type signature argument must be a Puppet Type, Class, or a String reference to a type. Got #{t.class}\"\n+          raise ArgumentError, \"Type signature argument must be a Ruby Type Class, or a String reference to a Puppet Data Type. Got #{t.class}\"","path":"lib/puppet/functions.rb","position":664,"original_position":665,"commit_id":"19e513475cc82e55c1c4cec7aa053703740aa2c4","original_commit_id":"3e368af10b9cff4e12d5f725ba23dbfe53472387","user":{"login":"jpartlow","id":183241,"avatar_url":"https://avatars.githubusercontent.com/u/183241?","gravatar_id":"e9ebfedba32a338542b3adb482cf0e0f","url":"https://api.github.com/users/jpartlow","html_url":"https://github.com/jpartlow","followers_url":"https://api.github.com/users/jpartlow/followers","following_url":"https://api.github.com/users/jpartlow/following{/other_user}","gists_url":"https://api.github.com/users/jpartlow/gists{/gist_id}","starred_url":"https://api.github.com/users/jpartlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpartlow/subscriptions","organizations_url":"https://api.github.com/users/jpartlow/orgs","repos_url":"https://api.github.com/users/jpartlow/repos","events_url":"https://api.github.com/users/jpartlow/events{/privacy}","received_events_url":"https://api.github.com/users/jpartlow/received_events","type":"User","site_admin":false},"body":"Is the list of acceptable 'Ruby Types' simply enumerable (a short enough list to be explicit in the message)?","created_at":"2014-04-21T22:06:53Z","updated_at":"2014-04-21T22:06:53Z","html_url":"https://github.com/puppetlabs/puppet/pull/2561#discussion_r11828819","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/2561","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/11828819"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/2561#discussion_r11828819"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/2561"}}}}