Module: Alf::Support::OrderedSet

Extended by:
Domain::Reuse::Helpers
Included in:
Types::AttrList, Types::Keys
Defined in:
lib/alf/support/ordered_set.rb

Instance Method Summary collapse

Instance Method Details

#&(other) ⇒ Object


17
18
19
# File 'lib/alf/support/ordered_set.rb', line 17

def &(other)
  self.class.new (elements & self.class.coerce(other).elements)
end

#-(other) ⇒ Object


13
14
15
# File 'lib/alf/support/ordered_set.rb', line 13

def -(other)
  self.class.new (elements - self.class.coerce(other).elements)
end

#elementsObject


9
10
11
# File 'lib/alf/support/ordered_set.rb', line 9

def elements
  reused_instance
end

#map(&bl) ⇒ Object


26
27
28
# File 'lib/alf/support/ordered_set.rb', line 26

def map(&bl)
  self.class.new reused_instance.map(&bl).uniq
end

#|(other) ⇒ Object Also known as: +


21
22
23
# File 'lib/alf/support/ordered_set.rb', line 21

def |(other)
  self.class.new (elements | self.class.coerce(other).elements)
end