Sha256: 9e2ec6e99c85fadd12201db84378dd4002cdbdab0eddb20a65f3e18c8e0632bd

Contents?: true

Size: 544 Bytes

Versions: 4

Compression:

Stored size: 544 Bytes

Contents

module BB
  module FactoryDecorator
    module From
      private

      def format_filters(expressions)
        expressions.map(&method(:format_condition)).compact
      end

      def format_condition(value)
        Converter::Table.convert(value, options.dup)
      end

      def format_type_of_component
        if options.key?(:as) && filters.size > 1
          :from_union_all_with_alias
        elsif options.key?(:as) && filters.size == 1
          :from_with_alias
        else
          :from
        end
      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/from.rb
b_b-0.1.2 lib/b_b/factory_decorator/from.rb
b_b-0.1.1 lib/b_b/factory_decorator/from.rb
b_b-0.1.0 lib/b_b/factory_decorator/from.rb