Module: Flock::Mixins::Sizeable

Included in:
SelectOperation
Defined in:
lib/flock/mixins/sizeable.rb

Instance Method Summary collapse

Instance Method Details

#any?(&block) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
# File 'lib/flock/mixins/sizeable.rb', line 4

def any?(&block)
  if !block_given?
    size > 0
  else
    map(&block).any?
  end
end

#empty?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/flock/mixins/sizeable.rb', line 12

def empty?
  size == 0
end