Sha256: 21032ab3f78949314eda2e0272639518b3e8799ee6e5385123961f1ef97d6f6d

Contents?: true

Size: 664 Bytes

Versions: 9

Compression:

Stored size: 664 Bytes

Contents

module RademadeAdmin
  module Search
    module Part
      class Abstract

        attr_reader :parts

        def initialize
          @parts = []
        end

        def add(field, value)
          @parts << part_object(field, value)
        end

        def unshift(field, value)
          @parts.unshift(part_object(field, value))
        end

        def sub_add(part)
          @parts << part
        end

        def sub_unshift(part)
          @parts.unshift part
        end

        protected

        def part_object(field, value)
          {
            :field => field,
            :value => value
          }
        end

      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rademade_admin-0.2.2 app/services/search/part/abstract.rb
rademade_admin-0.2.1 app/services/search/part/abstract.rb
rademade_admin-0.2.0 app/services/search/part/abstract.rb
rademade_admin-0.1.6 app/services/search/part/abstract.rb
rademade_admin-0.1.5 app/services/search/part/abstract.rb
rademade_admin-0.1.4 app/services/search/part/abstract.rb
rademade_admin-0.1.3 app/services/search/part/abstract.rb
rademade_admin-0.1.2 app/services/search/part/abstract.rb
rademade_admin-0.1.1 app/services/search/part/abstract.rb