Class: BCDD::Contract::RespondTo::Checking

Inherits:
Object
  • Object
show all
Includes:
Core::Checking
Defined in:
lib/bcdd/ext/contract/respond_to.rb

Instance Method Summary collapse

Constructor Details

#initialize(method_names, value) ⇒ Checking

Returns a new instance of Checking.



9
10
11
12
13
14
# File 'lib/bcdd/ext/contract/respond_to.rb', line 9

def initialize(method_names, value)
  @value = value
  @errors = []

  validate(method_names, @errors)
end

Instance Method Details

#errors_messageObject



16
17
18
# File 'lib/bcdd/ext/contract/respond_to.rb', line 16

def errors_message
  valid? ? '' : errors[0]
end