Class: Languages::FunctionBehavior Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/kuniri/language/abstract_container/structured_and_oo/function_behavior.rb

Overview

This class is abstract.

This class is responsible for handling elements whose the

behaviour is similar to a function. For example, method and global function has a very similar behaviour, because of this is a good idea to use this class as parent.

Direct Known Subclasses

Ruby::FunctionBehaviorRuby

Instance Method Summary collapse

Instance Method Details

#detect_function(pLine) ⇒ Object (protected)

Detect function in line.

Parameters:

  • pLine

    Line string with the potential method inside.

Returns:

  • Return the method if it is find in the string, othewise return nil.

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/kuniri/language/abstract_container/structured_and_oo/function_behavior.rb', line 26

def detect_function(pLine)
  raise NotImplementedError
end

#get_function(pLine, type = 'globalFunction') ⇒ Object

Verify if line has a potential function.

Parameters:

  • pLine

    String with potencial function.

Returns:

  • Returns FuntionData, or nil if line doesn't have method.

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/kuniri/language/abstract_container/structured_and_oo/function_behavior.rb', line 14

def get_function(pLine, type = 'globalFunction')
  raise NotImplementedError
end

#handling_default_parameter(pLine) ⇒ Object (protected)

Handling default parameters.

Parameters:

  • pLine

    Line to be check.

Returns:

  • Return a string.

Raises:

  • (NotImplementedError)


40
41
42
# File 'lib/kuniri/language/abstract_container/structured_and_oo/function_behavior.rb', line 40

def handling_default_parameter(pLine)
  raise NotImplementedError
end

#handling_parameter(pLine) ⇒ Object (protected)

Handling parameters.

Parameters:

  • pLine

    String to try to find the parameters.

Returns:

  • Return a list with all the parameter, othewise return nil

Raises:

  • (NotImplementedError)


47
48
49
# File 'lib/kuniri/language/abstract_container/structured_and_oo/function_behavior.rb', line 47

def handling_parameter(pLine)
  raise NotImplementedError
end

#remove_unnecessary_information(pLine) ⇒ Object (protected)

Remove unnecessary information inside the string.

Parameters:

  • pLine

    Line for handling the string.

Returns:

  • Return a string.

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/kuniri/language/abstract_container/structured_and_oo/function_behavior.rb', line 33

def remove_unnecessary_information(pLine)
  raise NotImplementedError
end