Class: LintFu::Plugins::ActionPack::ControllerEidosBuilder

Inherits:
EidosBuilder
  • Object
show all
Defined in:
lib/lint_fu/plugins/action_pack/controller_eidos_builder.rb

Constant Summary collapse

SIGNATURE_SEXP =
s(:colon2, s(:const, :ActionController), :Base)

Instance Attribute Summary

Attributes inherited from EidosBuilder

#current_model_element, #eide, #namespace

Instance Method Summary collapse

Methods inherited from EidosBuilder

#build, #initialize, #process_module

Constructor Details

This class inherits a constructor from LintFu::EidosBuilder

Instance Method Details

#process_class(sexp) ⇒ Object

sexp
:class, <classname>, <superclass|nil>, <CLASS DEFS>


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/lint_fu/plugins/action_pack/controller_eidos_builder.rb', line 7

def process_class(sexp)
  return super(sexp) unless sexp[2] && sexp[2] == SIGNATURE_SEXP
  
  unless self.current_model_element
    self.current_model_element = ControllerEidos.new(sexp, self.namespace)
    did_element = true
  end

  ret = super(sexp)

  if did_element
    self.eide.push self.current_model_element
    self.current_model_element = nil
  end

  return ret
end