Sha256: 71f848af6e1a8ae1b656fa97570e6be01a93fd64095af62a03ae14202bf9c45b

Contents?: true

Size: 382 Bytes

Versions: 1

Compression:

Stored size: 382 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    class NewLambdaLiteral < Cop
      MSG = 'Use the new lambda literal syntax ->(params) {...}.'

      TARGET = s(:send, nil, :lambda)

      def on_send(node)
        if node == TARGET && node.loc.selector.source != '->'
          add_offence(:convention, node.loc.line, MSG)
        end

        super
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubocop-0.8.0 lib/rubocop/cop/new_lambda_literal.rb