Class: Languages::RubySyntax

Inherits:
Language show all
Defined in:
lib/kuniri/language/ruby/ruby_syntax.rb

Overview

Handling the ruby syntax for extract information.

Instance Attribute Summary

Attributes inherited from Language

#aggregationHandler, #aggregationState, #attributeHandler, #attributeState, #classHandler, #classState, #commentHandler, #commentState, #conditionalHandler, #conditionalState, #constructorHandler, #constructorState, #countNestedCondLoop, #endBlockHandler, #externRequirementHandler, #fileElements, #flagFunctionBehaviour, #functionHandler, #functionState, #idleState, #includeState, #metadata, #methodHandler, #methodState, #moduleHandler, #moduleState, #name, #path, #previousState, #repetitionHandler, #repetitionState, #state, #string_comment_to_transfer, #variableHandler, #variableState

Instance Method Summary collapse

Methods inherited from Language

#aggregation_capture, #attribute_capture, #attribute_extract, #class_capture, #class_extract, #comment_extract, #conditional_capture, #constructor_capture, #extern_requirement_extract, #function_capture, #global_variable_extract, #handle_line, #idle_capture, #include_capture, #isNested?, #lessNested, #method_capture, #method_extract, #module_capture, #moreNested, #resetNested, #rewind_state, #set_source, #set_state, #variable_capture

Constructor Details

#initializeRubySyntax

Returns a new instance of RubySyntax.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/kuniri/language/ruby/ruby_syntax.rb', line 27

def initialize
  super
  @externRequirementHandler = Languages::Ruby::ExternRequirementRuby.new
  @variableHandler = Languages::Ruby::VariableGlobalRuby.new
  @functionHandler = Languages::Ruby::FunctionBehaviorRuby.new
  @moduleHandler = Languages::Ruby::ModuleNamespaceRuby.new
  @classHandler = Languages::Ruby::ClassRuby.new
  @attributeHandler = Languages::Ruby::AttributeRuby.new
  @endBlockHandler = Languages::Ruby::EndBlockRuby.new
  @methodHandler = Languages::Ruby::MethodRuby.new
  @constructorHandler = Languages::Ruby::ConstructorRuby.new
  @conditionalHandler = Languages::Ruby::ConditionalRuby.new
  @repetitionHandler = Languages::Ruby::RepetitionRuby.new
  @commentHandler = Languages::Ruby::CommentRuby.new
  @aggregationHandler = Languages::Ruby::AggregationRuby.new
  @metadata = Languages::Metadata.create
  @visibility = "public"
end

Instance Method Details

#analyse_source(pPath) ⇒ Object

Analyse source code.

Parameters:

  • pPath

    Path of file to be analysed.



48
49
50
51
52
53
# File 'lib/kuniri/language/ruby/ruby_syntax.rb', line 48

def analyse_source(pPath)
  @name = File.basename(pPath, ".*")
  @path = File.dirname(pPath)
  analyse_first_step(pPath)
  analyse_second_step
end