Module: Hugger::Object Private
- Included in:
- String
- Defined in:
- lib/hugger/object.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Object
Constant Summary collapse
- STRING_MATCHER =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
/\A[[:space:]]*\z/
Instance Method Summary collapse
-
#blank? ⇒ TrueClass, FalseClass
private
Checks object is blank.
- #object ⇒ TrueClass, FalseClass private
-
#present? ⇒ TrueClass, FalseClass
private
Checks object is present.
Instance Method Details
#blank? ⇒ TrueClass, FalseClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Checks object is blank
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/hugger/object.rb', line 11 def blank? case object when String, ::String STRING_MATCHER === object # rubocop:disable Style/CaseEquality # when Hash, ::Hash, ::Array # object.empty? # when TrueClass, Numeric # false # when FalseClass, NilClass # true # else # object.respond_to?(:empty?) ? object.empty? : !self end end |
#object ⇒ TrueClass, FalseClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
36 37 38 |
# File 'lib/hugger/object.rb', line 36 def object raise 'Not' end |
#present? ⇒ TrueClass, FalseClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Checks object is present
29 30 31 |
# File 'lib/hugger/object.rb', line 29 def present? !blank? end |