Class: PHP::Interface

Inherits:
PHP::Statement show all
Defined in:
lib/php/syntax/interface.rb

Overview

See Also:

Instance Attribute Summary

Instance Method Summary

Methods inherited from PHP::Node

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

Constructor Details

- (Interface) initialize(name, options = {})

A new instance of Interface

Parameters:

  • (Symbol, #to_s) name
  • (Hash{Symbol => Object} options) Hash{Symbol — => Object} options


12
13
14
# File 'lib/php/syntax/interface.rb', line 12

def initialize(name, options = {})
  @name, @options = Identifier.new(name).to_sym, options
end

Instance Attribute Details

- (Symbol) name

Returns:

  • (Symbol)


7
8
9
# File 'lib/php/syntax/interface.rb', line 7

def name
  @name
end

Instance Method Details

- (String) to_php

Returns the PHP representation of this interface.

Returns:

  • (String)


20
21
22
# File 'lib/php/syntax/interface.rb', line 20

def to_php
  "interface #{name} {}" # TODO
end