Sha256: f7d1de476e7c4de95954850a8a03cdb15117e32925252952ff0a0c17760b777f

Contents?: true

Size: 743 Bytes

Versions: 7

Compression:

Stored size: 743 Bytes

Contents

# frozen_string_literal: true

module Expressir
  module Liquid
    module Statements
      class IfDrop < ::Expressir::Liquid::StatementDrop
        def initialize(model)
          @model = model
          super
        end

        def expression
          drop_klass_by_model(@model.expression)
        end

        def statements
          return [] unless @model.statements

          @model.statements.map do |item|
            ::Expressir::Liquid::StatementDrop.new(item)
          end
        end

        def else_statements
          return [] unless @model.else_statements

          @model.else_statements.map do |item|
            ::Expressir::Liquid::StatementDrop.new(item)
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
expressir-2.1.6 lib/expressir/liquid/statements/if_drop.rb
expressir-2.1.5 lib/expressir/liquid/statements/if_drop.rb
expressir-2.1.4 lib/expressir/liquid/statements/if_drop.rb
expressir-2.1.3 lib/expressir/liquid/statements/if_drop.rb
expressir-2.1.2 lib/expressir/liquid/statements/if_drop.rb
expressir-2.1.1 lib/expressir/liquid/statements/if_drop.rb
expressir-2.1.0 lib/expressir/liquid/statements/if_drop.rb