Module: Minidbc::SubclassMethods

Defined in:
lib/minidbc.rb

Instance Method Summary collapse

Instance Method Details

#invariantsObject



69
70
71
# File 'lib/minidbc.rb', line 69

def invariants
  @invariants.concat( superclass.invariants )
end

#postconds(method_name) ⇒ Object



65
66
67
# File 'lib/minidbc.rb', line 65

def postconds(method_name)
  ( @minidbc_posts[method_name] || [] ).concat( superclass.postconds(method_name) )
end

#preconds(method_name) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/minidbc.rb', line 51

def preconds(method_name)
  preconds = @minidbc_pres[method_name]
  super_preconds = superclass.preconds(method_name)
  if preconds
    if !super_preconds.empty?
      puts "Warnning: You have override precondition for #{method_name}. You can only lose them"
    else
      preconds
    end
  else
    super_preconds
  end
end