Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/shorthand.rb
Instance Method Summary collapse
- #blank? ⇒ Boolean
- #maybe ⇒ Object
- #numeric? ⇒ Boolean
- #presence ⇒ Object
- #present? ⇒ Boolean
- #to_sig ⇒ Object
Instance Method Details
#blank? ⇒ Boolean
27 |
# File 'lib/shorthand.rb', line 27 def blank?() respond_to?(:empty?) ? empty? : !self end |
#maybe ⇒ Object
28 |
# File 'lib/shorthand.rb', line 28 def maybe() self.nil? ? Nilish.global : self end |
#numeric? ⇒ Boolean
32 |
# File 'lib/shorthand.rb', line 32 def numeric?() respond_to?(:to_f) end |
#presence ⇒ Object
30 |
# File 'lib/shorthand.rb', line 30 def presence() self if present? end |
#present? ⇒ Boolean
29 |
# File 'lib/shorthand.rb', line 29 def present?() !blank? end |
#to_sig ⇒ Object
31 |
# File 'lib/shorthand.rb', line 31 def to_sig() Digest::SHA1.digest(self.to_s).base64url end |