Class: PHP::Operator::Unary

Inherits:
PHP::Operator show all
Defined in:
lib/php/syntax/operator.rb

Instance Attribute Summary

Instance Method Summary

Methods inherited from PHP::Operator

for, #operator, #to_a

Methods inherited from PHP::Node

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

Constructor Details

- (Unary) initialize(operand)

A new instance of Unary

Parameters:



72
73
74
# File 'lib/php/syntax/operator.rb', line 72

def initialize(operand)
  @operand = operand
end

Instance Attribute Details

- (Expression) operand

Returns:



68
69
70
# File 'lib/php/syntax/operator.rb', line 68

def operand
  @operand
end

Instance Method Details

- (Array(Expression)) operands

Returns the operands for this operation.

Returns:



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

def operands
  [operand]
end

- (String) to_php

Returns the PHP representation of this operation.

Returns:



88
89
90
# File 'lib/php/syntax/operator.rb', line 88

def to_php
  "#{operator}#{operand}"
end