Class: Jade::Type::Application

Inherits:
Data
  • Object
show all
Includes:
Base
Defined in:
lib/jade/type/application.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



3
4
5
# File 'lib/jade/type/application.rb', line 3

def args
  @args
end

#constructorObject (readonly)

Returns the value of attribute constructor

Returns:

  • (Object)

    the current value of constructor



3
4
5
# File 'lib/jade/type/application.rb', line 3

def constructor
  @constructor
end

Instance Method Details

#to_sObject



6
7
8
9
10
11
12
13
14
# File 'lib/jade/type/application.rb', line 6

def to_s
  return constructor.to_s if args.empty?

  if constructor.name.start_with?('Tuple.Tuple')
    return "(#{args.map(&:to_s).join(', ')})"
  end

  "#{constructor.to_s}(#{args.map(&:to_s).join(", ")})"
end

#unbound_varsObject



16
17
18
# File 'lib/jade/type/application.rb', line 16

def unbound_vars
  constructor.unbound_vars + args.flat_map(&:unbound_vars)
end