Module: LLT::Helpers::Functions

Defined in:
lib/llt/helpers/functions.rb

Instance Method Summary collapse

Instance Method Details

#has_f?(function) ⇒ Boolean

Shortcut methods

Returns:

  • (Boolean)


16
17
18
19
20
21
22
# File 'lib/llt/helpers/functions.rb', line 16

def has_f?(function)
  # Do not alias or delegate.
  #
  # It's (slightly) faster that way and this method will usually
  # get lots of calls.
  functions.include?(function)
end

#has_function?(function) ⇒ Boolean

Objects that use this module must implement #functions, which shall respond to #include?

Returns:

  • (Boolean)


7
8
9
# File 'lib/llt/helpers/functions.rb', line 7

def has_function?(function)
  functions.include?(function)
end

#has_not_function?(function) ⇒ Boolean Also known as: has_not_f?

Returns:

  • (Boolean)


11
12
13
# File 'lib/llt/helpers/functions.rb', line 11

def has_not_function? function
  ! has_function?(function)
end