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

Since:

  • 0.0.1

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.

Since:

  • 0.0.1

/\A[[:space:]]*\z/

Instance Method Summary collapse

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

Returns:

  • (TrueClass, FalseClass)

Since:

  • 0.0.1



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

#objectTrueClass, 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.

Returns:

  • (TrueClass, FalseClass)

Since:

  • 0.0.1



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

Returns:

  • (TrueClass, FalseClass)

Since:

  • 0.0.1



29
30
31
# File 'lib/hugger/object.rb', line 29

def present?
  !blank?
end