Sha256: d8a0e7d904ecdb100a09ae177ba4771aa52d3c9acee24f6a802b823387fc5e92

Contents?: true

Size: 335 Bytes

Versions: 3

Compression:

Stored size: 335 Bytes

Contents

# TODO: remove Object#try_call
class Object
  # If receiver is callable, calls it and returns result.
  # If not, just returns receiver itself
  #
  # @return [Object]
  # @api private
  def try_call(*args)
    if self.respond_to?(:call)
      self.call(*args)
    else
      self
    end
  end

  def validatable?
    false
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sbf-dm-validations-1.4.0 lib/data_mapper/validation/support/object.rb
sbf-dm-validations-1.3.0 lib/data_mapper/validation/support/object.rb
sbf-dm-validations-1.3.0.beta lib/data_mapper/validation/support/object.rb