Class: Contract

Inherits:
Object
  • Object
show all
Defined in:
lib/rubidity.rb

Overview

for easy use / convenience

pack everything into Contract.load( path/name )

Class Method Summary collapse

Class Method Details

.load(path, generate: true) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rubidity.rb', line 19

def self.load( path, generate: true )

  source = Builder.load_file( path ).source
  pp source
  pp source.contracts
  
  puts "  #{source.contracts.size} contract(s) in source (unit):"
  source.contracts.each do |contract|
      print "   #{contract.name}"
      print " is #{contract.is.inspect}"   unless contract.is.empty?
      print "\n"
  end
  
  ####################
  ### generate contract classes
  source.generate   if generate
   
  source  ## return source (unit) - why? why not?   
end