Class: PHP::Function::Call

Inherits:
PHP::Expression show all
Defined in:
lib/php/syntax/function.rb

Overview

See Also:

Instance Attribute Summary

Instance Method Summary

Methods inherited from PHP::Node

#<<, #<=>, #children?, #each, #indent, #indent=, #to_s

Constructor Details

- (Call) initialize(function, *arguments)

A new instance of Call

Parameters:

  • (Symbol, #to_s) function
  • (Array<Expression>) arguments


85
86
87
88
# File 'lib/php/syntax/function.rb', line 85

def initialize(function, *arguments)
  @function  = Identifier.new(function).to_sym
  @arguments = arguments
end

Instance Attribute Details

- (Array<Expression>) arguments

Returns:



80
81
82
# File 'lib/php/syntax/function.rb', line 80

def arguments
  @arguments
end

- (Symbol) function

Returns:

  • (Symbol)


76
77
78
# File 'lib/php/syntax/function.rb', line 76

def function
  @function
end

Instance Method Details

- (String) to_php

Returns the PHP representation of this function call.

Returns:

  • (String)


94
95
96
# File 'lib/php/syntax/function.rb', line 94

def to_php
  "#{function}(#{arguments.join(', ')})"
end