Method: RepeatJoinPlugin#set_count

Defined in:
lib/tecsgen/plugin/RepeatJoinPlugin.rb

#set_count(rhs) ⇒ Object

count オプションの解析



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/tecsgen/plugin/RepeatJoinPlugin.rb', line 115

def set_count(rhs)
  if rhs =~ /\A\d+\z/
    @count = rhs.to_i
  else
    nsp = NamespacePath.new(rhs.to_sym, true)
    expr = Expression.create_single_identifier(nsp, nil)
    res = expr.eval_const(nil)
    if res.nil?
      cdl_error("count value ($1): not single identifier or integer number", rhs.to_s)
      @count = 0
    else
      @count = res
    end
  end
end