Class: Rea::Model::Context

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

Instance Method Summary collapse

Instance Method Details

#conversion(name, &block) ⇒ Object



25
26
27
28
29
# File 'lib/rea/model.rb', line 25

def conversion name, &block
  $conversion = ::Rea::MetaType::Conversion.new
  $conversion.instance_eval &block
  symbol_table[name] = $conversion
end

#entities(&block) ⇒ Object



5
6
7
# File 'lib/rea/model.rb', line 5

def entities &block
  instance_eval &block
end

#exchange(name, &block) ⇒ Object



19
20
21
22
23
# File 'lib/rea/model.rb', line 19

def exchange name, &block
  $exchange = ::Rea::MetaType::Exchange.new
  $exchange.instance_eval &block
  symbol_table[name] = $exchange
end

#processes(&block) ⇒ Object



15
16
17
# File 'lib/rea/model.rb', line 15

def processes &block
  instance_eval &block
end

#symbol_tableObject



32
33
34
# File 'lib/rea/model.rb', line 32

def symbol_table
  @symbol_table ||= {}.with_indifferent_access
end