Class: Jade::Frontend::PatternAnalysis::Constructor

Inherits:
Data
  • Object
show all
Defined in:
lib/jade/frontend/pattern_analysis.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



17
18
19
# File 'lib/jade/frontend/pattern_analysis.rb', line 17

def args
  @args
end

#constructorObject (readonly)

Returns the value of attribute constructor

Returns:

  • (Object)

    the current value of constructor



17
18
19
# File 'lib/jade/frontend/pattern_analysis.rb', line 17

def constructor
  @constructor
end

Instance Method Details

#to_sObject



20
21
22
23
24
25
26
27
# File 'lib/jade/frontend/pattern_analysis.rb', line 20

def to_s
  if constructor.start_with?('Tuple.')
    "(#{args.map(&:to_s).join(', ')})"
  else
    name = constructor.split('.').last
    args.empty? ? name : "#{name}(#{args.map(&:to_s).join(', ')})"
  end
end

#wildcard?Boolean

Returns:

  • (Boolean)


18
# File 'lib/jade/frontend/pattern_analysis.rb', line 18

def wildcard?; false; end