Sha256: 4cf2be3855ad405b54d5a9c4e1ac8708bc120f06e066a4ce64e0e73de10090b7
Contents?: true
Size: 728 Bytes
Versions: 8
Compression:
Stored size: 728 Bytes
Contents
module SearchKit module Models class Keys include Enumerable def self.[](*arguments) new(arguments) end attr_reader :contents, :member_class def initialize(contents = []) @contents = contents @member_class = SearchKit::Models::Key end def <<(new_key) case new_key when Hash then contents << member_class.new(new_key) when member_class then contents << new_key else contents end end def each(&block) contents.each(&block) end def creator self.class.new(select(&:creator?)) end def tokens contents.map(&:token) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems