Class: Object

Inherits:
BasicObject
Defined in:
lib/shorthand.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


27
# File 'lib/shorthand.rb', line 27

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

#maybeObject



28
# File 'lib/shorthand.rb', line 28

def maybe()      self.nil? ? Nilish.global : self         end

#numeric?Boolean

Returns:

  • (Boolean)


32
# File 'lib/shorthand.rb', line 32

def numeric?()   respond_to?(:to_f)                       end

#presenceObject



30
# File 'lib/shorthand.rb', line 30

def presence()   self if present?                         end

#present?Boolean

Returns:

  • (Boolean)


29
# File 'lib/shorthand.rb', line 29

def present?()   !blank?                                  end

#to_sigObject



31
# File 'lib/shorthand.rb', line 31

def to_sig()     Digest::SHA1.digest(self.to_s).base64url end