Class: RubyNestNats::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_nest_nats/utils.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.blank?(value) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/ruby_nest_nats/utils.rb', line 7

def blank?(value)
  value.respond_to?(:empty?) ? value.empty? : !value
end

.presence(value) ⇒ Object



15
16
17
# File 'lib/ruby_nest_nats/utils.rb', line 15

def presence(value)
  present?(value) ? value : nil
end

.present?(value) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/ruby_nest_nats/utils.rb', line 11

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