Class: Object

Inherits:
BasicObject
Defined in:
lib/dm-validations/support/object.rb

Instance Method Summary collapse

Instance Method Details

#try_call(*args) ⇒ Object

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.

If receiver is callable, calls it and returns result. If not, just returns receiver itself

Returns:



7
8
9
10
11
12
13
# File 'lib/dm-validations/support/object.rb', line 7

def try_call(*args)
  if self.respond_to?(:call)
    self.call(*args)
  else
    self
  end
end

#validatable?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/dm-validations/support/object.rb', line 15

def validatable?
  false
end