Class: Cuboid::Support::Filter::Set

Inherits:
Base show all
Defined in:
lib/cuboid/support/filter/set.rb

Overview

Filter based on a Set.

Author:

Constant Summary

Constants inherited from Base

Base::DEFAULT_OPTIONS

Instance Attribute Summary

Attributes inherited from Base

#collection

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#<<, #==, #_dump, _load, #any?, #clear, #dup, #empty?, #hash, #include?, #merge, #size

Constructor Details

#initializeSet

Returns a new instance of Set.

Parameters:

  • options (Set)


12
13
14
15
# File 'lib/cuboid/support/filter/set.rb', line 12

def initialize(*)
    super
    @collection = ::Set.new
end

Class Method Details

.from_rpc_data(data) ⇒ Object



21
22
23
24
# File 'lib/cuboid/support/filter/set.rb', line 21

def self.from_rpc_data( data )
    options, items = data
    new( options ).merge items
end

Instance Method Details

#to_rpc_dataObject



17
18
19
# File 'lib/cuboid/support/filter/set.rb', line 17

def to_rpc_data
    [@options, @collection.to_a]
end