Class: Object

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

Instance Method Summary collapse

Instance Method Details

#try_call(*args) ⇒ Object

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

Returns:



10
11
12
13
14
15
16
# File 'lib/dm-validations.rb', line 10

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

#validatable?Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/dm-validations/support/object.rb', line 2

def validatable?
  false
end