Class: Languages::Attribute Abstract

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

Overview

This class is abstract.

Abstract class for handling attribute.

Direct Known Subclasses

Ruby::AttributeRuby

Instance Method Summary collapse

Instance Method Details

#detect_attribute(pLine) ⇒ Object (protected)

Detect if line has attribute.

Parameters:

  • pLine

    Line with potential attribute.

Returns:

  • Return a matched STRING or nil if not found.

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/kuniri/language/abstract_container/structured_and_oo/attribute.rb', line 25

def detect_attribute(pLine)
  raise NotImplementedError
end

#get_attribute(pLine) ⇒ Object

Verify if a line has an attribute. If it has attribute, firstly, the function capture all lines and removes specific language declaration (for instance, in ruby it is: "@" or ":" and whitespace), finally it splits the string by an special character and return an object of AttributeData.

Parameters:

  • pLine

    An line to be analysed for find attribute.

Returns:

  • Return on filled object of AttributeData if it find an attribute, otherwise it returns nil.

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/kuniri/language/abstract_container/structured_and_oo/attribute.rb', line 16

def get_attribute(pLine)
  raise NotImplementedError
end