Module: SelectorQuery

Included in:
Selector
Defined in:
tomes/components/selector/selector_query.rb

Overview

All methods for checking the state of the Selector.

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Checks if #memory is nil.

Returns:

  • (Boolean)


27
28
29
# File 'tomes/components/selector/selector_query.rb', line 27

def blank?
  memory.nil?
end

#empty?Boolean

Checks if #possession is nil.

Returns:

  • (Boolean)


14
15
16
# File 'tomes/components/selector/selector_query.rb', line 14

def empty?
  possession.nil?
end

#has?(this) ⇒ Boolean

Checks if #possession has the given object.

Parameters:

  • this (Object)

    This can be anything.

Returns:

  • (Boolean)


8
9
10
# File 'tomes/components/selector/selector_query.rb', line 8

def has?(this)
  possession == this
end

#knows?(this) ⇒ Boolean

Checks if #memory contains the given data.

Parameters:

  • this (Object)

    This can be anything.

Returns:

  • (Boolean)


21
22
23
# File 'tomes/components/selector/selector_query.rb', line 21

def knows?(this)
  memory == this
end