Sha256: 2c5bd1c1f646676dc858b452a7b64b6d6234ad65ea39e8c9fe185ed99f33d9aa
Contents?: true
Size: 396 Bytes
Versions: 13
Compression:
Stored size: 396 Bytes
Contents
module ObjectAttorney module Helpers extend self def is_integer?(string) string.match(/^(\d)+$/) end def plural?(string) string = string.to_s string == string.pluralize end def try_or_return(object, method, default_value) returning_value = object.try(method) returning_value.nil? ? default_value : returning_value end end end
Version data entries
13 entries across 13 versions & 1 rubygems