Module: CapybaraBox::Helper

Defined in:
lib/capybara-box/helper.rb

Class Method Summary collapse

Class Method Details

.blank?(value) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/capybara-box/helper.rb', line 7

def blank?(value)
  [''].include?(value.to_s.strip)
end

.present?(value) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/capybara-box/helper.rb', line 11

def present?(value)
  !blank?(value)
end

.true?(value) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/capybara-box/helper.rb', line 15

def true?(value)
  ['true', true].include?(value)
end