Module: Support

Extended by:
FnValidations
Included in:
SocialNetsDB::SocialNet, SocialNetsDB::SocialNet, TagHelper
Defined in:
lib/social_nets_db/support.rb

Instance Method Summary collapse

Methods included from FnValidations

validate_argument_boolean!, validate_argument_positive!, validate_argument_presence!, validate_argument_type!, validate_collection_item_types!

Instance Method Details

#present_str?(arg) ⇒ Boolean

Direct analogue of Rails’ ‘String#present?`

Parameters:

  • arg (Any)

    the thing to check

Returns:

  • (Boolean)

    is the passed argument is a non-empty String



12
13
14
# File 'lib/social_nets_db/support.rb', line 12

def present_str?(arg)
  arg.is_a?(String) && arg != ""
end