Sha256: 59d7bfaef443cd4cb413a1b74fb3ac30fa98d377a58bcf00c83317086f19e4f6

Contents?: true

Size: 381 Bytes

Versions: 5

Compression:

Stored size: 381 Bytes

Contents

module Grape
  class Entity
    module Condition
      class BlockCondition < Base
        attr_reader :block

        def setup(&block)
          @block = block
        end

        def ==(other)
          super && @block == other.block
        end

        def if_value(entity, options)
          entity.exec_with_object(options, &@block)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
grape-entity-0.6.1 lib/grape_entity/condition/block_condition.rb
grape-entity-0.6.0 lib/grape_entity/condition/block_condition.rb
grape-entity-0.5.2 lib/grape_entity/condition/block_condition.rb
grape-entity-0.5.1 lib/grape_entity/condition/block_condition.rb
grape-entity-0.5.0 lib/grape_entity/condition/block_condition.rb