Sha256: dcbb33ea80e1727ab15d302208fbf50a67b252a243f38c9b3b0027e2ed77ce38
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true require 'active_set/version' require 'active_set/processors/filter_processor' require 'active_set/processors/sort_processor' require 'active_set/processors/paginate_processor' class ActiveSet include Enumerable attr_reader :set def initialize(set) @set = set end def each(&block) @set.each(&block) end def ==(other) return @set == other unless other.is_a?(ActiveSet) @set == other.set end def method_missing(method_name, *args, &block) @set.send(method_name, *args, &block) || super end def respond_to_missing?(method_name, include_private = false) @set.respond_to?(method_name) || super end def filter(structure) filterer = FilterProcessor.new(@set, structure) self.class.new(filterer.process) end def sort(structure) sorter = SortProcessor.new(@set, structure) self.class.new(sorter.process) end def paginate(structure) paginater = PaginateProcessor.new(@set, structure) self.class.new(paginater.process) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activeset-0.3.1 | lib/active_set.rb |
activeset-0.3.0 | lib/active_set.rb |