Sha256: 54d1d602677e9144967695c0aec695ce43ff7346414ac24e188d41bfe5c16570

Contents?: true

Size: 371 Bytes

Versions: 8

Compression:

Stored size: 371 Bytes

Contents

class DRG::Decorators::SexpDecorator < DelegateClass(Sexp)
  def each_sexp_condition
    return enum_for(__method__) unless block_given?
    each_sexp do |exp|
      next unless exp.is_a?(Sexp)
      if exp.first == :if
        yield exp
      elsif nested_sexp = exp.enum_for(:deep_each).find { |s| s.first == :if }
        yield nested_sexp
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
drg-0.15.3 lib/drg/decorators/sexp_decorator.rb
drg-0.15.2 lib/drg/decorators/sexp_decorator.rb
drg-0.15.1 lib/drg/decorators/sexp_decorator.rb
drg-0.15.0 lib/drg/decorators/sexp_decorator.rb
drg-0.14.3 lib/drg/decorators/sexp_decorator.rb
drg-0.14.2 lib/drg/decorators/sexp_decorator.rb
drg-0.14.1 lib/drg/decorators/sexp_decorator.rb
drg-0.14.0 lib/drg/decorators/sexp_decorator.rb