Sha256: 39e1697e2b530b9526936f0d814b6208ec8038b094d9019a319db81b6215f4fc

Contents?: true

Size: 491 Bytes

Versions: 5

Compression:

Stored size: 491 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|
        if rescue_reference.sexp_type == :const
          rescue_reference[1]
        end
      end.compact
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fasterer-0.2.0 lib/fasterer/rescue_call.rb
fasterer-0.1.12 lib/fasterer/rescue_call.rb
fasterer-0.1.11 lib/fasterer/rescue_call.rb
fasterer-0.1.10 lib/fasterer/rescue_call.rb
fasterer-0.1.9 lib/fasterer/rescue_call.rb