~ubuntu-branches/ubuntu/trusty/ruby-facets/trusty

« back to all changes in this revision

Viewing changes to lib/standard/facets/set.rb

  • Committer: Package Import Robot
  • Author(s): Marc Dequènes (Duck)
  • Date: 2013-06-21 14:41:38 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130621144138-nb3t82yl5gl8p7a6
Tags: 2.9.3-1
* New upstream release:
  - rakefile is gone, switched back to setuprb method
  - recreated documention build rules and adapted to new paths
* Updated copyright file.
* Increased Standards-Version to 3.9.4 (no changes).
* Removed transitional libfacets-* package and obsolete relations.
* Use system JQuery library instead of embedded one for documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
class Set
4
4
 
5
5
  #
 
6
  # @author Phrogz
6
7
  def power_set
7
8
    if empty?
8
 
      Set[ self ]
 
9
      Set[self]
9
10
    else
10
11
      any_value = [to_a.first]
11
12
      subsubs = (self - any_value).power_set
16
17
 
17
18
class Array
18
19
 
 
20
  # TODO: Move to Array extensions.
 
21
 
19
22
  #
 
23
  # @author Phrogz
20
24
  def power_set
21
25
    if empty?
22
26
      [self]