Method: Xumlidot::Parsers::Args#process_colon2

Defined in:
lib/xumlidot/parsers/args.rb

#process_colon2(exp) ⇒ Object

Colon2 means that we have a constant assignment such as (a = Foo::Bar)



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/xumlidot/parsers/args.rb', line 57

def process_colon2(exp)
  name = exp.flatten
  name.delete :const
  name.delete :colon2

  leader = ''
  if name.first == :colon3
    leader = '::'
    name.delete :colon3
  end

  # I'm not sure how best to proceed here.
  #
  # I can use const_set to start creating the constants heirachy
  # but this is complex since it needs to be inserted into the right
  # place and for that I need the namespace...which suggests this ISNT
  # the place to do that. I possibly need a fake class ...
  @argument.default = leader + name.map do |v| # rubocop:disable Style/SymbolProc
    v.to_s
  end.to_a.join('::')

  s()
end