Class: Proc::Signature

Inherits:
Object
  • Object
show all
Defined in:
lib/decompiler/proc/signature.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args, arg_info) ⇒ Signature

Returns a new instance of Signature.



155
156
157
158
# File 'lib/decompiler/proc/signature.rb', line 155

def initialize(args, arg_info)
  @args = args
  @arg_info = arg_info
end

Instance Attribute Details

#arg_infoObject (readonly)

Returns the value of attribute arg_info.



153
154
155
# File 'lib/decompiler/proc/signature.rb', line 153

def arg_info
  @arg_info
end

#argsObject (readonly)

Returns the value of attribute args.



153
154
155
# File 'lib/decompiler/proc/signature.rb', line 153

def args
  @args
end

Instance Method Details

#to_sObject



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/decompiler/proc/signature.rb', line 160

def to_s
  if @args.unspecified then
    return ""
  elsif @args.multiple_assignment then
    if @args.empty_last_arg then
      params = @args.map{ |n| arg_info[n] }
      return "|#{@arg_info[@args[0]]},|"
    else
      params = @args.map{ |n| arg_info[n] }
      return "|#{params.join(', ')}|"
    end
  else
    return "|#{@arg_info[@args[0]]}|"
  end
end