Module: Origen::Parameters::ClassMethods

Defined in:
lib/origen/parameters.rb

Instance Method Summary collapse

Instance Method Details

#parameters_context(obj = nil) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/origen/parameters.rb', line 12

def parameters_context(obj = nil)
  if obj
    if obj.is_a?(Symbol)
      valid = [:top, :dut].include?(obj)
    end
    valid ||= obj.is_a?(String)
    unless valid
      fail 'Invalid parameters context, must be :top or a string path to a model object'
    end
    @parameters_context = obj
  else
    @parameters_context
  end
end