Module: OmfEc::Backward::DSL

Defined in:
omf_ec/lib/omf_ec/backward/dsl.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) included(base)



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'omf_ec/lib/omf_ec/backward/dsl.rb', line 10

def included(base)
  v5_style(:defProperty, base)
  v5_style(:defEvent, base)
  v5_style(:onEvent, base)
  v5_style(:allEqual, base)
  v5_style(:onEvent, base)
  v5_style(:allGroups, base)
  v5_style(:allNodes!, base)
  v5_style(:defGraph, base)
  v5_style(:defGroup, base)
  v5_style(:loadOEDL, base)
  v5_style(:ensureProperty, base)
  v5_style(:defQuery, base)
  v5_style(:getResources, base)
end

+ (Object) v5_style(name, base)



26
27
28
29
30
31
32
33
# File 'omf_ec/lib/omf_ec/backward/dsl.rb', line 26

def v5_style(name, base)
  new_name = name.to_s.underscore.to_sym
  unless method_defined? new_name
    base.class_eval do
      alias_method name, new_name
    end
  end
end

Instance Method Details

- (Object) defApplication(uri, name = nil, &block)



36
37
38
39
40
41
# File 'omf_ec/lib/omf_ec/backward/dsl.rb', line 36

def defApplication(uri, name=nil ,&block)
  # URI parameter was used by previous OMF5 EC, for now we
  # do nothing with it in OMF6
  name = uri if name.nil?
  def_application(name,&block)
end

- (Object) wait(duration)

Wait for some time before issuing more commands

Parameters:

  • duration (Fixnum)

    Time to wait in seconds (can be



47
48
49
50
51
# File 'omf_ec/lib/omf_ec/backward/dsl.rb', line 47

def wait(duration)
  info "Request from Experiment Script: Wait for #{duration}s...."
  warn "Calling 'wait' or 'sleep' will block entire EC event loop. Please try 'after' or 'every'"
  sleep duration.to_s.to_i
end