Class: Object

Inherits:
BasicObject
Defined in:
lib/nfse_gyn/extensions.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/nfse_gyn/extensions.rb', line 10

def blank?
  respond_to?(:empty?) ? !!empty? : !self
end

#present?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/nfse_gyn/extensions.rb', line 14

def present?
  !blank?
end

#try(method_name, *args, &block) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/nfse_gyn/extensions.rb', line 2

def try(method_name, *args, &block)
  if method_name.nil? || !respond_to?(method_name)
    nil
  else
    public_send(method_name, *args, &block)
  end
end