Sha256: a7f9b2d298731625b9f20fc58f7e3fb3b0121db140162dc94555ebbcc0aeb993

Contents?: true

Size: 386 Bytes

Versions: 4

Compression:

Stored size: 386 Bytes

Contents

module BB
  module FactoryDecorator
    module Limit
      private

      def format_filters(expressions)
        expressions.select(&method(:match?)).map(&:to_i)
      end

      def match?(value)
        value.respond_to?(:to_i) && !value.to_i.zero?
      end

      def format_type_of_component
        options.key?(:offset) ? :limit_with_offset : :limit
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
b_b-0.1.3 lib/b_b/factory_decorator/limit.rb
b_b-0.1.2 lib/b_b/factory_decorator/limit.rb
b_b-0.1.1 lib/b_b/factory_decorator/limit.rb
b_b-0.1.0 lib/b_b/factory_decorator/limit.rb