Class: LintFu::ActionPack::ModelControllerBuilder

Inherits:
ModelElementBuilder show all
Defined in:
lib/lint_fu/action_pack/model_controller_builder.rb

Constant Summary collapse

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

Instance Attribute Summary

Attributes inherited from ModelElementBuilder

#model_elements, #namespace

Instance Method Summary collapse

Methods inherited from ModelElementBuilder

#initialize, #process_module

Constructor Details

This class inherits a constructor from LintFu::ModelElementBuilder

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/action_pack/model_controller_builder.rb', line 7

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

  ret = super(sexp)

  if did_element
    self.model_elements.push @current_model_element
    @current_model_element = nil
  end

  return ret
end