Class: Set

Inherits:
Object show all
Includes:
Roby::DRoby::V5::Builtins::SetDumper
Defined in:
lib/roby/backports.rb,
lib/roby/support.rb

Overview

List of backports waiting to be accepted in the backports gem

Instance Method Summary collapse

Methods included from Roby::DRoby::V5::Builtins::SetDumper

#droby_dump, #proxy

Instance Method Details

#compare_by_identityObject

Defined in 2.4.0

Hash#compare_by_identity appeared in ruby 1.9.1



8
9
10
# File 'lib/roby/backports.rb', line 8

def compare_by_identity
    @hash.compare_by_identity
end

#compare_by_identity?Boolean

Defined in 2.4.0

Hash#compare_by_identity? appeard in ruby 1.9.1

Returns:

  • (Boolean)


15
16
17
# File 'lib/roby/backports.rb', line 15

def compare_by_identity?
    @hash.compare_by_identity?
end

#inspectObject



57
58
59
# File 'lib/roby/support.rb', line 57

def inspect
    to_s
end

#intersect?(set) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (ArgumentError)


62
63
64
65
66
67
68
69
70
# File 'lib/roby/support.rb', line 62

def intersect?(set)
    raise ArgumentError, "value must be a set" unless set.kind_of?(Set)

    if size < set.size
        any? { |o| set.include?(o) }
    else
        set.any? { |o| include?(o) }
    end
end