Sha256: ce699910a9e4ffde2230af9ffb815e91dfa66c87e5f3e8be6f11653fa21b8148

Contents?: true

Size: 468 Bytes

Versions: 20

Compression:

Stored size: 468 Bytes

Contents

module Fasterer
  class RescueCall
    attr_reader :element
    attr_reader :rescue_classes

    def initialize(element)
      @element = element
      @rescue_classes = []
      set_rescue_classes
    end

    private

    def set_rescue_classes
      return if element[1].sexp_type != :array

      @rescue_classes = element[1].drop(1).map do |rescue_reference|
        rescue_reference[1] if rescue_reference.sexp_type == :const
      end.compact
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
fasterer-0.11.0 lib/fasterer/rescue_call.rb
fasterer-0.10.1 lib/fasterer/rescue_call.rb
fasterer-0.10.0 lib/fasterer/rescue_call.rb
fasterer-0.9.0 lib/fasterer/rescue_call.rb
fasterer-0.8.3 lib/fasterer/rescue_call.rb
fasterer-0.8.2 lib/fasterer/rescue_call.rb
fasterer-0.8.1 lib/fasterer/rescue_call.rb
fasterer-0.8.0 lib/fasterer/rescue_call.rb
fasterer-0.7.1 lib/fasterer/rescue_call.rb
fasterer-0.7.0 lib/fasterer/rescue_call.rb
fasterer-0.6.0 lib/fasterer/rescue_call.rb
fasterer-0.5.1 lib/fasterer/rescue_call.rb
fasterer-0.5.0 lib/fasterer/rescue_call.rb
fasterer-0.4.2 lib/fasterer/rescue_call.rb
fasterer-0.4.1 lib/fasterer/rescue_call.rb
fasterer-0.4.0 lib/fasterer/rescue_call.rb
fasterer-0.3.2 lib/fasterer/rescue_call.rb
fasterer-0.3.1 lib/fasterer/rescue_call.rb
fasterer-0.3.0 lib/fasterer/rescue_call.rb
fasterer-0.2.1 lib/fasterer/rescue_call.rb