Sha256: 5b48834764c3fac57e44610bbbe38c3691dd4ca3059e92e36f1f0a1981f09423

Contents?: true

Size: 404 Bytes

Versions: 33

Compression:

Stored size: 404 Bytes

Contents

require 'reek/code_context'

module Reek
  class IfContext < CodeContext
    attr_reader :if_expr
    
    def initialize(outer, exp)
      @outer = outer
      @exp = exp
      @if_expr = exp[1]
    end
    
    def tests_a_parameter?
      @if_expr[0] == :lvar and has_parameter(@if_expr[1])
    end

    def outer_name
      @outer.outer_name
    end

    def to_s
      @outer.to_s
    end
  end
end

Version data entries

33 entries across 33 versions & 3 rubygems

Version Path
kevinrutherford-reek-0.3.1.4 lib/reek/if_context.rb
kevinrutherford-reek-0.3.1.5 lib/reek/if_context.rb
kevinrutherford-reek-0.3.1.6 lib/reek/if_context.rb
kevinrutherford-reek-1.0.0 lib/reek/if_context.rb
kevinrutherford-reek-1.0.1 lib/reek/if_context.rb
kevinrutherford-reek-1.1.1 lib/reek/if_context.rb
kevinrutherford-reek-1.1.2.1 lib/reek/if_context.rb
kevinrutherford-reek-1.1.2 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.1 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.10 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.11 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.12 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.13 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.14 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.15 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.16 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.2 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.3 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.4 lib/reek/if_context.rb
kevinrutherford-reek-1.1.3.5 lib/reek/if_context.rb